Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected t

Posted by SheoNarayan under Error and Solution on 2/15/2011 | Points: 10 | Views : 35442 | Status : [Administrator] | Replies : 2

When I was trying to use the WCF Service hosted on Console app, I got following errror.

Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'..

The possible solution of this problem is

1. Ensure that Binding information in the client and service is same. For example if you are using wsHttpBinding in the service, ensure that the same binding is there on the client as well. (This is the frequently faced problem)

2. Do not keep more than one MessageEncoding type into the config file.

3. Change the binding type to basicHttpBinding at both client and service end.

Hope this will help someone.

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com



Responses

Posted by: Karthikanbarasan on: 2/16/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Good One to note down!!!

Thanks
Karthik
www.f5Debug.net

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 2/16/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Yes it is always advisable to make sure that we use the same bindings at both the Server and the Client side.

Thanks and Regards
Madhu

SheoNarayan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response