Wednesday, May 12, 2010

Receiving Large amounts of Data through a WCF Receive Location

Recently I have been working on a project where an application will break a file down into a 64 bit byte stream and then send the file to BizTalk.  I am receiving all types of files, including pictures and documents.  I am using WCF for the communication protocol and of course I instantly got a 400 Bad Request error message - telling me message size was too big.  First I changed the client config file, changed the maxReceivedMessageSize and the maxBufferPoolSize.  While these changes were necessary to get the messages to BizTalk, I was still getting the 400 Bad Request error message.  I had generated the WCF service using the BizTalk WCF Publishing Wizard and knew that the maxReceivedMessageSize property was not in the web.config of my service.  The property is in fact located on the receive location, see below:

I increased the value to 500,000 and everything worked. 

Its one of those property values that you look at everyday, but when you actually need to set the value you forget all about it.