代码之家  ›  专栏  ›  技术社区  ›  Bhuvan

WCF CustomBinding Duplex无法打开客户端端口

  •  2
  • Bhuvan  · 技术社区  · 16 年前

    我正在使用wsDualHttpBinding,它可以工作,但是非常慢。我分析过,大多数时间都被序列化程序和身份验证过程使用。因此,我决定使用二进制编码,并更改传输的安全性,因为它是一个内部网应用程序,加密是没有必要的。

    <wsDualHttpBinding>
            <binding name="CRMXServiceDualBinding" sendTimeout="00:10:00"
              maxBufferPoolSize="50524288" maxReceivedMessageSize="50000000"
              messageEncoding="Mtom">
              <readerQuotas maxDepth="50000000" maxStringContentLength="50000000"
                maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
              <reliableSession ordered="true" inactivityTimeout="00:30:00" />
              <security mode="Message">
                <message clientCredentialType="Windows" negotiateServiceCredential="true" />
              </security>
            </binding>
          </wsDualHttpBinding>
    

    所以我试着编写这个定制绑定。

    <customBinding>
            <binding name="DuplexBindingConfig">
              <compositeDuplex />
              <oneWay maxAcceptedChannels="128" packetRoutable="false">
                <channelPoolSettings idleTimeout="00:10:00" leaseTimeout="00:10:00"
                  maxOutboundChannelsPerEndpoint="10" />
              </oneWay>
              <binaryMessageEncoding maxReadPoolSize="64" maxWritePoolSize="16">
                <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
                  maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              </binaryMessageEncoding>
              <httpTransport manualAddressing="false" maxBufferPoolSize="2147483647"
                maxReceivedMessageSize="2147483647" allowCookies="false" authenticationScheme="Negotiate"
                bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                keepAliveEnabled="true" maxBufferSize="2147483647" proxyAuthenticationScheme="Anonymous"
                realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
                useDefaultWebProxy="true" />
            </binding>
          </customBinding>
    

    现在我面临两个问题: “HTTP请求未经客户端身份验证方案“协商”授权。从服务器接收的身份验证标头是“NTLM”。“ 我的预感是客户端端口没有被打开。

    *顺便说一句,我使用的是windowsxpsp3,framework3.5sp1,VS2008

    1 回复  |  直到 16 年前
        1
  •  4
  •   Andrew Shepherd    16 年前

    客户机将通过一个通用端口侦听器(即,一个不是Web服务的侦听器)进行侦听,并且不了解使SSL工作所需的详细信息。