【发布时间】:2011-02-25 18:13:02
【问题描述】:
我正在尝试使用位于https://TestServices/ServiceList.asmx 的网络服务。当我尝试向我的 C# 库类项目添加服务引用时,我的 app.config 文件如下所示:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="TestServicesSoap" closeTimeout="00:01:00" openTimeout="00:01:00"
receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="50000000" maxBufferPoolSize="524288" maxReceivedMessageSize="50000000"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
</transport>
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://TestServices/ServiceList.asmx"
binding="basicHttpBinding" bindingConfiguration="TestServicesSoap"
contract="TestServices.TestServicesSoap" name="TestServicesSoap" />
</client>
</system.serviceModel>
即使我出于某种原因尝试添加对 https://TestServices/ServiceList.asmx 的服务引用,端点地址仍指向 http://TestServices/ServiceList.asmx。我尝试将 http 更改为 https,但出现以下错误:
提供的 URI 方案“https”无效;预期的“http”。 参数名称:通过
在 https 上使用 web 服务的正确方法是什么?
【问题讨论】:
标签: c# asp.net web-services