简体   繁体   English

WCF CustomBinding双工无法打开客户端端口

[英]WCF CustomBinding Duplex Fails to Open Client port

I am struggling with this duplex WCF service which makes calls to the service to get large amounts of data. 我正在努力使用这种双向WCF服务,该服务对该服务进行调用以获取大量数据。 I am using wsDualHttpBinding which works but is very slow. 我正在使用wsDualHttpBinding,但效果很慢。 I profiled and most time is being used by Serializers and authentication process. 我进行了分析,大多数时间都由序列化程序和身份验证过程使用。 So I decided to use Binary Encoding and change the Security to Transport and since it is an intranet application, encryption is not that necessary. 因此,我决定使用二进制编码并将“安全性”更改为“传输”,并且由于它是Intranet应用程序,因此不需要加密。

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

So I tried to compose this Custom binding. 因此,我尝试编写此自定义绑定。

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

Now I am facing two problems: 1. To test on ASP.Net development server it immediately returns the error: "The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'." 现在,我面临两个问题:1.要在ASP.Net开发服务器上进行测试,它将立即返回错误:“ HTTP请求未经客户端身份验证方案'Negotiate'的授权。从服务器收到的身份验证标头为'NTLM'。” 2. Testing on IIS6, the call never reaches the server. 2.在IIS6上测试,该呼叫永远不会到达服务器。 My Hunch is that the Client port is not being opened. 我的工作是未打开客户端端口。

Please Help.. Thanks in advance. 请帮助。。在此先感谢。

*BTW i am using Windows XP SP3, Framework 3.5 SP1, VS2008 *顺便说一句,我正在使用Windows XP SP3,Framework 3.5 SP1,VS2008

I can see one problem: 我可以看到一个问题:

You cannot use transport level security on a duplex http binding, even a custom duplex http binding. 您不能在双工http绑定(甚至自定义双工http绑定)上使用传输级安全性。

The client will listen through a generic port listener (that is, one that is not a Web Service) and will not understand the details that are required to make SSL work. 客户端将通过通用端口侦听器(即不是Web服务的侦听器)进行侦听,并且不会理解使SSL工作所需的详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM