我在服务器 PC 上的 WCF 中构建了一个 web 服务。我已经创建了一个 https 端点并配置了一些本地证书。现在在网络上,我正在尝试创建一个 C# 控制台客户端来测试服务。但我收到此错误:未处理的异常:System.ServiceModel.Security.SecurityNegotiationException:调用者未通过服务进行身份验证。---> System.ServiceModel.FaultE 异常:无法满足对安全令牌的请求,因为身份验证失败。(以及更多)..
这是我要连接到的端点的代码:
这将是我的客户:
<bindings>
<wsHttpBinding>
<binding name="WebDataServiceHttpBinding" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://anlocalip:9651/WebDataService" binding="wsHttpBinding"
bindingConfiguration="WebDataServiceHttpBinding" contract="wcf1.IWebDataService"
name="WebDataServiceHttpBinding">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
我无法摆脱这个错误,有人可以帮助我吗???