Configuring a BizTalk WCF Inbound Service with BasicHttp for Large Messages

Exposing a BizTalk schema or orchestration as a WCF service is usually a pretty easy process, especially with the help of the BizTalk WCF Service Publishing Wizard. But when you expose BizTalk artifacts as basicHttp WCF services, you end up being able to use only the default reader quota settings for the protocol for items such as maxArrayLength (16384), maxBytesPerRead (4096), maxDepth (32), and maxStringContentLength (8192). This will present problems when dealing with larger messages.

One common error is:

The adapter "WCF-BasicHttp" raised an error message. Details "System.Xml.XmlException: The 'maximum bytes per Read operation' quota (4096) has been exceeded while reading XML data. Long element start tags (consisting of the element name, attribute names and attribute values) may trigger this quota. This quota may be increased by changing the MaxBytesPerRead property on the XmlDictionaryReaderQuotas object used when creating the XML reader

This problem, among others, is discussed here:

One work-around is to reconfigure the Receive Location in BizTalk to use the WCF-Custom adapter instead of WCF-BasicHttp. Remember that the adapter settings will override anything in the service’s .config file. The WCF-Custom adapter allows much more configuration than the WCF-BasicHttp adapter and will allow you to set all these readerQuota values to much higher levels needed to support larger messages.

If you’re interested in how to set up the WCF-Custom adapter to use Basic Http, just comment or email me and I’ll create a post to discuss how it is done.


About Ed Jones

Ed is a .NET and Integration architect for Avanade in the Twin Cities. Contact Ed

3 responses to “Configuring a BizTalk WCF Inbound Service with BasicHttp for Large Messages”

  1. Ralphie says :

    I’d like to see how to set up the Basic in the Custom. I’m getting the read error but can’t seem to get the correct config with the custom. Also, I’m using a Security mode of TransportCredentialOnly, with a type of Ntlm.

    All help appreciated,


  2. Ed Jones says :

    Any specific exceptions, other than the one mentioned in the article that might provide some insight?

What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: