简体   繁体   English

如何启用http和https端点?

[英]How can I enable both http and https endpoint?

I am accessing the service which has is setup in the WAS server that 我正在访问WAS服务器中已设置的服务

allows both http and https endpoint access. 允许http和https端点访问。 How can I modify same in my app.config file? 如何在我的app.config文件中进行修改?

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>    
<add key="WebServiceUrl1" value="http://vissvc-  test.e.corpintra.net/VisSvcNative/VisService"/>
<add key="LogoutUrl" value="http://login.e.corpintra.net/internal/logout"/>
</appSettings>
<system.net>
<defaultProxy >
  <proxy autoDetect ="True" />
</defaultProxy>
</system.net> 
<system.serviceModel>
<bindings>      
  <customBinding>
    <binding name="SoapBinding">  
      <customTextMessageEncoding encoding="UTF-8" messageVersion="Soap11" />  
      <httpTransport/>          
    </binding>       
  </customBinding>      
</bindings>        
<client>
  <endpoint address="http://vissvc-test.e.corpintra.net/VisSvcNative/VisService"
            binding="customBinding" bindingConfiguration="SoapBinding"                contract="ServiceReference1.VisServicePortType" name="VisService" behaviorConfiguration="behavior" />      
               </client>
 </system.serviceModel>
 </configuration>

I am using .net c# 4.0 我正在使用.net c#4.0

You might need to add <httpsTransport> under <httpTransport> as well. 您可能需要添加<httpsTransport><httpTransport>为好。

Take a look at MSDN for more information on the <httpsTransport> tag. 请查看MSDN ,以获取有关<httpsTransport>标记的更多信息。

EDIT: What I mean is there should be another binding configuration for the <httpsTransport> , for example: 编辑:我的意思是<httpsTransport>应该有另一个绑定配置,例如:

<bindings>      
  <customBinding>
     <binding name="SoapBinding">
        <httpTransport />
     </binding>
     <binding name="HttpsSoapBinding">
        <httpsTransport />
     </binding>     
  </customBinding>      
</bindings>  

Also note that these binding names have to match that on the server configuration. 还请注意,这些绑定名称必须与服务器配置上的名称匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以为同一端点使用普通的http和https - Can I use normal http and https for the same endpoint 如何在HTTP和HTTPS中监听自托管的Azure中继终结点? - How to listen self-hosted Azure Relay endpoint in both HTTP & HTTPS? WCF:以编程方式在同一ip /端口上同时启用https和http - WCF: Programmatically enable both https and http on same ip/port 如何启用CAS仪表板(“ / status / dashboard”端点) - How can I enable CAS Dashboard (“/status/dashboard” endpoint) 我希望我的Web API可以同时使用HTTP和HTTPS请求 - I want my web API work with both HTTP and HTTPS requests 在自定义绑定上启用HTTP和HTTPS - Enable HTTP and HTTPS on a custom binding 如何使用httplistener启用https? - How do I enable https with httplistener? 我有 HTTP 方案并且需要 HTTPS,但我的绑定是 BasicHttpSecurityMode.Transport; 我的端点是 HTTP - I have HTTP scheme and HTTPS is expected, but my binding is BasicHttpSecurityMode.Transport; And my EndPoint is HTTP 我该如何发出在代理和无代理情况下均可使用的ac#https Web请求 - How can I make a c# https web request that works in both proxy and no proxy situations 如何检查两个文本框内是否都包含文本,然后启用另一个按钮? - How can i check if both textBoxes are with text inside and then to enable another button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM