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.