Web Service 'content type' error

Problem

When trying to execute something against a web service, you receive the following error message:

Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'

In addition to the above error message, you may also receive text that indicates that customErrors need to be set to 'Off', if you wish to see the real error message.

Solution

The "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'" error message is a red herring. It is true that the response was not in the expected format, but the real issue is descrebed in the "improperly" formatted response. In my case, because the web service's web.config file had customErrors set to "RemoteOnly", I had change this value to "Off" in order to see the real error message. The real issue had to do with permissions and was specific to the web service I was dealing with.

Published Friday, March 13, 2009 9:58 AM by Tod Birdsall

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Picture of Tod Birdsall

Welcome!

This is the personal website of Tod Birdsall, a programmer, business analyst, and gamer. Not necessarily in that order. Learn more...

Subscribe

Be notified of my latest posts. Subscribe to my blog.