2

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

这是我的客户端配置:

       <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)。

4

1 回答 1

4

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

     <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转向NonenegotiateServiceCredential转向false

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

 <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>

通知security modeNone

于 2011-10-24T11:48:12.223 回答