Use WCF Binary Encoding when Host in IIS6

I wanted to replace .Net Remoting calls with WCF.

Article From .NET Remoting to the Windows Communication Foundation (WCF)was very useful for me. It was misleading reference to Attribute ReturnUnknownExceptionsAsFaults which doesn’t exist any more.It has been changed to IncludeExceptionDetailInFaults,

I wanted to use WCF Binary Encoding when Host in Windows 2003 Server(IIS6) instead of text encoding, that is coming out-of-the-box
I found the blog WCF: Enable Binary Encoding Over Http
and literally copied custom binding settings from the blog
<binding name="NetHttpBinding">
         <reliableSession />
         <compositeDuplex />
         <oneWay />
         <binaryMessageEncoding />
         <httpTransport />
       </binding>


I was able to call the service successfully, but then client  was timed-out on response. It took me some time to debug until I recognized that the settings include    <oneWay />
Obviously it should be removed, if i am using a synchronous call.

So the minimum custom binding settings is
<binding name="BinaryHttpBinding">
          <binaryMessageEncoding />
         <httpTransport />
</binding>

If you have big objects to transfer, you need to increase size limits similar to the following
       <binding name="BinaryHttpBinding"><!--For Remoting-->
                   <binaryMessageEncoding >
                       <readerQuotas   maxStringContentLength="43647" />                    </binaryMessageEncoding>
                   <httpTransport maxReceivedMessageSize="83647" />                 </binding>


Discussion that helped http://stackoverflow.com/questions/3367197/wcf-custombinding-duplex-fails-to-open-client-port

posted @ Monday, May 16, 2011 6:42 AM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)

 
 
 
 
 

Live Comment Preview:

 
«July»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789