views:

45

answers:

1

I am struggling with this duplex WCF service which makes calls to the service to get large amounts of data. I am using wsDualHttpBinding which works but is very slow. 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.

<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'." 2. Testing on IIS6, the call never reaches the server. 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

+1  A: 

I can see one problem:

You cannot use transport level security on a duplex http binding, even a custom duplex http binding.

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.

Andrew Shepherd
Thanks Andrew for the Quick response. Is there any way that I can use Binary Encoder with similar configuration as the above wsDualHttpBinding with Encryption Off.. so that I get better performance. The Performance of the current wsDualHttpBinding is very slow.
Bhuvan
In your post you say you changed from Message-Level security to Transport. Simply change the security to none at all. Then you should be able to have Duplex over HTTP using a binary encoder.
Andrew Shepherd
Thanks Andrew for the suggestion..HTTPTransport does not Support None.. instead support anonymous. But this option skips authentication all together .. and I need user info (authentication) to be available. I had to do a workaround by passing UserName as a custom header and using it in the Authorization manager. I believe that this is not a good solution.. but for now it is working. I am still searching for right solution.. where I need Authentication.. and establish context.. once per session.. on a duplex service.. over a lightweight channel which is fast.
Bhuvan