Friday, June 3, 2011

The content type text/html; charset=utf-8 of the response message does not match

When you face a following issue once you hosted a WCF service in IIS

“The content type text/html; charset=utf-8 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. The first 1024 bytes of the response were”

This reason might be you have to set up WAS (Windows Process Activation Service). The WAS is the generalization of IIS features that work with non-HTTP transfer protocol like by WCF, such as TCP, named pipes, and Message Queue . Basically WCF uses the listener adapter interface to communicate activation requests that are received over the non-HTTP protocols supported by WCF, such as TCP, named pipes, and Message Queue.

To install the WCF non-HTTP activation components
1. Click the Start button, and then click Control Panel.
2. Click Programs, and then click Programs and Features.
3. On the Tasks menu, click Turn Windows features on or off.
4. Find the .NET Framework 3.0 node, select and then expand it.
















5. Select the WCF Non-Http Activation Components box and click on Next.




Please refer this MSDN artical for more details

No comments:

Post a Comment