【发布时间】:2017-02-14 05:24:38
【问题描述】:
我有一个我正在尝试使用的 SOAP,但我遇到了下一个问题,我在类似问题中找不到解决方案:
必须通过 HTTPS 并使用 Windows 凭据调用 SOAP。
我在应用配置中尝试做的是接下来的事情:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpsBinding>
<binding name="WebServiceSoap">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Windows" />
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpsBinding>
</bindings>
<client>
<endpoint address="https://someapp/SDK/WebService.asmx"
binding="basicHttpsBinding" bindingConfiguration="WebServiceSoap"
contract="someapp_contract.WebServiceSoap" name="WebServiceSoap" />
</client>
</system.serviceModel>
</configuration>
我得到的错误是:
The username is not provided. Specify username in ClientCredentials.And the error
我也用 basicHttpBinding 尝试了不同的配置 和
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
但是我得到的错误是(这是一个非常合乎逻辑的错误):
provided URI scheme 'https' is invalid; expected 'http'...
过去有没有人遇到过同样的问题?
提前致谢。
最大
附注:
如果我这样做了
<security mode="Transport">
而不是
<security mode="TransportWithMessageCredential">
我得到下一个错误:
The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate,NTLM'.
【问题讨论】:
标签: c# winforms web-services soap service-reference