This is obvious in retrospect, but I am blogging this in case anyone else comes across the same problem.
When writing my first VS 2008 Windows Forms app that used a Web Service, after adding the service reference and the code to talk to it, I repeatedly received the following error:
The content type text/xml; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8).
Googling this was frustrating; nothing was related, although I did go down a few blind alleys trying things I found on a couple sites. I spent an hour or two Googling and using the .NET Encoding converters to write convoluted conversion code to change the charset, to no avail.
The answer turned out to be embarrassingly simple: I set the Web Service reference incorrectly.
Finally I tried consuming the Web Service from VS 2005. I noticed right away the options in the dialog to add the web service were different. And then my code just worked.
The error I received, as is often the case, had nothing to do with the actual cause of the problem.
Apparently, Microsoft, all gaga over its new WCF-style Web Services, has deeply buried the setting of references to "old-style", aka bog-standard, everyone-on-the-planet-uses-this-kind, XML Web Services. Thanks, Microsoft.
I had made the mistake of setting the reference directly in the "Add Service Reference" dialog; this is actually for the new WCF Web Services, as I discovered.
Turns out, to get a reference to an "old-style" Web Service, you need to first click the "Advanced" button in the bottom-left corner of the "Add Service Reference" dialog. Then, you need to click the "Add Web reference" button in the bottom-left corner of the "Advanced" dialog. After all that, you can properly set the reference, in the usual manner.
I also noticed that, magically, the next time I looked at the VS menu, there was a brand-new "Add Web Reference" option on the menu that was not there before. As if to really drive you nuts, making you think it was there all along and you just didn’t see it:
Note the 2 different reference options: "Add Web Reference", for adding an "old-style" Web Service reference, and "Add Service Reference", for adding a WCF Web Service reference. Could this menu be any more confusing?
Hopefully this will help someone else avoid the wasted time.