gpt4 book ai didi

.net - WCF错误: The caller was not authenticated by the service

转载 作者:行者123 更新时间:2023-12-03 06:52:31 26 4
gpt4 key购买 nike

我正在尝试从客户端控制台应用程序访问服务器上的 WCF 服务进行测试。我收到以下错误:

The caller was not authenticated by the service

我正在使用wsHttpBinding 。我不确定该服务需要哪种身份验证?



<behaviors>
<serviceBehaviors>
<behavior name="MyTrakerService.MyTrakerServiceBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>

更新如果我将绑定(bind)更改为 <endpoint "basicHttpBinding" ... /> 它就会起作用(来自 wsHttpBinding)在 IIS 7.0 托管的 Windows 2008 服务器上

最佳答案

如果您使用 basicHttpBinding,请将端点安全性配置为“None”并将 clientCredintialType 传输为“None”。

<bindings>
<basicHttpBinding>
<binding name="MyBasicHttpBinding">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyService">
<endpoint
binding="basicHttpBinding"
bindingConfiguration="MyBasicHttpBinding"
name="basicEndPoint"
contract="IMyService"
/>
</service>

此外,请确保 IIS 中的目录身份验证方法以启用匿名访问

关于.net - WCF错误: The caller was not authenticated by the service,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/284538/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com