gpt4 book ai didi

c# - WCF 调用者未通过 WsDualHttpBinding 中的服务进行身份验证

转载 作者:行者123 更新时间:2023-11-30 21:11:46 27 4
gpt4 key购买 nike

我有一个使用 wsDualHttpBinding 的 wcf 服务,当我尝试使用同一域中的不同 pc 连接到它时出现该错误。

这是我的客户端配置:

       <binding name="WSDualHttpBinding_IRouter" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>

如果我将安全性更改为:

        <binding name="WSDualHttpBinding_IRouter" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None">
<message negotiateServiceCredential="false" clientCredentialType="None" />
</security>

</binding>

我收到超时异常。

有人有解决方案吗?请注意,我使用的不是 wsDualHttpBinding(基本或 wsHttpBinding)。

最佳答案

我不得不把它作为客户端配置:

     <binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None">
<message clientCredentialType="None" negotiateServiceCredential="false" />
</security>
</binding>

注意将 security mode 设置为 None 并将 negotiateServiceCredential 设置为 false

同样在服务器中,绑定(bind)应该是:

 <binding name="WSDualHttpBinding_IReceiverController" closeTimeout="00:00:05"
openTimeout="00:00:05" receiveTimeout="00:10:00" sendTimeout="00:00:05"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None" />
</binding>

注意安全模式None

关于c# - WCF 调用者未通过 WsDualHttpBinding 中的服务进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7866902/

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