HTTP Content-Type in ASP.Net SoapHttpClientProtocol

Posted by Daniel Fone on Stack Overflow See other posts from Stack Overflow or by Daniel Fone
Published on 2009-01-21T20:37:52Z Indexed on 2010/03/14 15:15 UTC
Read the original article Hit count: 732

Hi there,

I have a problem with a Web Service Consumer written in ASP.NET. The error message is:

System.InvalidOperationException: Client found response content type of 'application/xml; charset=utf-8', but expected 'text/xml'.

The client is based on System.Web.Services.Protocols.SoapHttpClientProtocol. We can't change the Content-Type given by the provider, this has to be 'application/xml; charset=utf-8'. Is there any way to change what Content-Type the SoapHttpClientProtocol expects? Unfortunately, we are probably limited to .NET 1.1.

Thanks!

Update: We found a way to change the Content-Type sent by the provider, and this solved the problem. I'd still be curious to know how to change the expectations of the consumer though.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about soap