Java JAX-WS客户端-如何处理“文本/普通”响应?
我正在使用jaxws客户端访问web服务。该服务似乎返回内容类型为“text/plain”而不是“text/xml”的响应,这导致我的客户端出现以下异常Java JAX-WS客户端-如何处理“文本/普通”响应?,java,jax-ws,webservice-client,Java,Jax Ws,Webservice Client,我正在使用jaxws客户端访问web服务。该服务似乎返回内容类型为“text/plain”而不是“text/xml”的响应,这导致我的客户端出现以下异常 com.sun.xml.internal.ws.server.UnsupportedMediaException: Unsupported Content-Type: text/plain Supported ones are: [text/xml] 创建端口时,我尝试了以下操作 port.getRequestContext().put(M
com.sun.xml.internal.ws.server.UnsupportedMediaException:
Unsupported Content-Type: text/plain Supported ones are: [text/xml]
创建端口时,我尝试了以下操作
port.getRequestContext().put(MessageContext.HTTP_RESPONSE_HEADERS,
Collections.singletonMap("Content-Type",
Collections.singletonList("text/plain")));
但这没有任何效果 就我所知,通过查看源代码,我认为与JDK1.6捆绑在一起的JAX-WSRI2.1不支持文本/纯文本,除非启用了MTOM