I am trying to use the Exchange 2010 web service interface using JAX-WS. I am using JAX-WS 2.2 RI (Metro 2.0). 2.1 the same problem appeared.
I'm having problems with Exchange, which returns "HTTP / 1.1 415 Cannot process the message because the content type is" text / xml; charset = utf-8 "was not the expected type" text / xml; charset = utf -8 '". as the answer (2.1 quotes the encoding value, otherwise the same answer).
Apparently, I need to dictate the exact Content-type header for Exchange in order to be happy.
Is there a way to do this without forcing me to manually rebuild the dependency? I currently rely on published maven artifacts and would like to continue to do so, if at all possible.
The consumption process is a regular J2SE application, with no visible containers. I control the application and can add almost everything that is required for the application area, but I can not add elements outside the process, such as proxies. Client classes were created from the local WSDL, but the charset specification is derived from the constants declared in the RI jaxws implementation, not the generated code. Thus, the received HTTP transport is processed by the standard http / https client from Sun JRE5 or JRE6.
source share