[英]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.