HTTP Content-Type in ASP.Net SoapHttpClientProtocol
- by Daniel Fone
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.