Geeks With Blogs

Michael Freidgeim's Blog MS .Net Development

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 on Monday, May 16, 2011 6:42 AM Web Services/WCF | Back to top


Comments on this post: Use WCF Binary Encoding when Host in IIS6

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net | Join free