Thursday, March 24, 2011

HTTP Content-Type in ASP.Net SoapHttpClientProtocol

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.

From stackoverflow
  • hallo daniel!

    What exactly was your solution?

    John Saunders : @Elif: please read the FAQ (stackoverflow.com/faq). This is not a discussion forum. If you have a question, ask a question of your own. Besides, it looks like his solution was specific to his provider.
  • Have the same problem here. And provider-change is not an option. :(

0 comments:

Post a Comment