I am accessing a web service using a jaxws client. The service seems to be returning responses with content-type as ‘text/plain’ instead of ‘text/xml’, this is causing the following exception in my client
com.sun.xml.internal.ws.server.UnsupportedMediaException:
Unsupported Content-Type: text/plain Supported ones are: [text/xml]
I tried the following when creating a port
port.getRequestContext().put(MessageContext.HTTP_RESPONSE_HEADERS,
Collections.singletonMap("Content-Type",
Collections.singletonList("text/plain")));
but this isn’t having any effect.
As far as I know (by looking at the source code), I think JAX-WS RI 2.1 bundled with JDK 1.6 doesn’t support “text/plain” unless MTOM is enabled.