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