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.

Rohit Sharma


Steef-Jan Wiggers said...

Good work Rohit!

Rohit Sharma said...

Thanks Steef-Jan!

Anonymous said...

Thanks Rohit for the sample.
I took the sample project provided and built and deploy to GAC. Also added as instructed in the machine.config. I do see the extension in the WCF-Custom adaptor and was able to configure as per instructions. However when I ran a test, I get an error in EventLog:
Details:"Microsoft.BizTalk.Adapter.Wcf.Converters.CreateBindingException: Unable to create binding element for binding "customBinding". ---> System.Configuration.ConfigurationErrorsException: Invalid element in configuration. The extension name 'customTextMessageEncoding' is not registered in the collection at system.serviceModel/extensions/bindingElementExtensions. (C:\Users\\AppData\Local\Temp\Config\dc54b5f4-f4c5-4eaf-b0ba-5ced56a31206.config line 20)

Post a Comment