我的服务调用导致以下错误:“提供的 URI 方案‘http’无效;需要‘https’。”
应用程序配置值:
<basicHttpBinding>
<binding name="xx_xxxxx_spcName" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="655360" maxBufferPoolSize="524288" maxReceivedMessageSize="655360"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
<client>
<endpoint address="http://server/serviceaddress_removed"
binding="basicHttpBinding" bindingConfiguration="xx_xxxxx_spcName"
contract="xx.xx_xxxxx_spcName" name="xx_xxxxx_spcName" />
</client>
我尝试过 https:// 但一切都是内部的,所以不会指望我需要这个,此外它还会给出客户端/服务器错误。
我也尝试过更改绑定类型
我还浏览了此处和 asp.net 上的其他论坛帖子,所有帖子似乎都指向使用 Transport 并传递客户端凭据,我在代码中执行的操作如下:
client.ClientCredentials.UserName.UserName = "XXXXX";
client.ClientCredentials.UserName.Password = "XXXXX";
你必须改变<security mode="Transport">
没有人。运输部队https。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)