Wednesday, February 6, 2013

Invoking a web service returning ISO-8859-1 encoded data with BizTalk Server 2010


The TextMessageEncodingBindingElement of WCF supports only the UTF-8, UTF-16 and Big Endean Unicode encodings. If the web service returns response in some other encoding e.g. ISO-8859-1 need to be consumed in BizTalk Server 2010 then the following error get logged in the event viewer:

System.ServiceModel.ProtocolException: The content type text/xml of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

I have published the solution to above problem along with the code at MSDN.

Cheers
Rohit Sharma