:-$

Ryan's work blog

My Links

News

The WeatherPixie
Subscribe with Bloglines
About this blog

Tools I use:

Post Categories

Article Categories

Archives

Image Galleries

Blog Stats

Personal

Projects

Random Blogs

Random other

Reference

Web comics

Work

Server found request content type to be '', but expected 'text/xml'.

I got this error when calling a C# web service from javascript. With a message like that, you'd think there was a problem with the Content-Type on my HTTP request.

Using the fine LiveHTTPHeaders Firefox extension, I saw in the headers:

Content-Type: text/xml; charset=UTF-8
Ok, so the content-type seemed ok, and it was time to start looking at my most recent changes to see where the bug was.

After a bit of hunting, I found the problem. My web service had an int parameter, and I was passing in 't1245'. That caused a casting error, which .NET cleverly reported back as a problem with the content-type.

Moral of the story: make your error messages meaningful.

posted on Thursday, November 10, 2005 5:43 PM