[ACCEPTED]-Client found response content type of 'text/html', but expected 'text/xml'-.net-2.0

Accepted answer
Score: 11

As Matt said, it's probably an error page 4 coming back.

Either use a proxy like Fiddler or 3 a network sniffer like WireShark to see what the 2 raw response is - that should help you get 1 to the bottom of what's going on.

Score: 9

Generally that error means that the service 11 has sent back an (HTML) error message rather 10 than the XML SOAP response that your client 9 was expecting.

For web services that you 8 control it's really easy to find the problem, because 7 you can invoke the webmethods by hand in 6 your browser. To diagnose it when it's someone 5 else's service is a little trickier. You 4 might be able to trace into the code for 3 your web reference and inspect the text 2 of the response before the exception is 1 thrown.

Score: 1

I have found Fiddler to be highly useful in debugging 3 http client server issues. It is a proxy 2 that allows you to intercept and even change 1 the content of the request and response.

Score: 0

In your actual code, replace the line:

searchRequest.AppID = "APP ID you generated from ...";

with 1 the actual AppID, which should be a long alpha-numeric sequence.

More Related questions