【发布时间】:2014-02-18 12:46:48
【问题描述】:
我正在访问在 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
【问题讨论】:
-
与论坛网站不同,我们不使用“谢谢”、“任何帮助表示赞赏”或Stack Overflow 上的签名。请参阅“Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?.
-
您正在使用的服务正在暴露 HTTP?
-
@MilanRaval- 它同时具有 http 和 https,vissvc-int.e.corpintra.net/VisSvcNative/VisService。我想包括三个端点,一个端点带有 http,两个端点带有 https。是的,在 app.config 中配置的是 HTTP。
标签: c# wcf app-config