0

So I am trying to consume a Java Web Service, that I don't control, through my .net application. My application sends the request with the header as:

Content-Type: application/soap+xml; charset=utf-8.

The response I get back has header as:

Content-Type: application/xop+xml; type="application/soap+xml"

The absence of UTF-8 in response gives me a Communication Exception as follows:

The content type application/xop+xml; type="application/soap+xml" of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:

Apparently as per: https://www.ietf.org/rfc/rfc3902.txt Charset is an optional parameter. So how do I fix this in .net. I have tried various binding combinations but nothing helped.

  • I doubt that missing the char set on the response will throw any exception. Better post the full exception info and the calling code with the line where the exception is thrown. – Gusman Jan 31 '17 at 19:25
  • Thanks @Gusman. I have updated my question with the error I am getting. Sorry, I can't post the code. – Anjani Kumar Agrawal Jan 31 '17 at 20:56
  • Try this http://stackoverflow.com/a/10497333/413337 or this http://stackoverflow.com/a/31801165/413337 – Codo Jan 31 '17 at 21:57
  • Thanks @Codo I had done my research before I posted this question. I had tried those solutions and any other binding combination I could and sorry they are not working for me. – Anjani Kumar Agrawal Feb 01 '17 at 16:31

0 Answers0