[英]How can I enable both http and https endpoint?
我正在访问WAS服务器中已设置的服务
允许http和https端点访问。 如何在我的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>
我正在使用.net c#4.0
您可能需要添加<httpsTransport>
在<httpTransport>
为好。
请查看MSDN ,以获取有关<httpsTransport>
标记的更多信息。
编辑:我的意思是<httpsTransport>
应该有另一个绑定配置,例如:
<bindings>
<customBinding>
<binding name="SoapBinding">
<httpTransport />
</binding>
<binding name="HttpsSoapBinding">
<httpsTransport />
</binding>
</customBinding>
</bindings>
还请注意,这些绑定名称必须与服务器配置上的名称匹配。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.