JAXWS Dispatch.invoke ... javax.xml.stream.XMLStreamException:尝试声明前缀xmlns(根据NS 1.1#4非法)

时间:2018-07-05 13:37:51

标签: java jax-ws soap-client

我正在使用动态调度JAX-WS客户端来调用第三方Web服务。 javax.xml.ws.Dispatch.invoke(...)方法在被调用时抛出

  

javax.xml.stream.XMLStreamException:尝试声明前缀xmlns(根据NS 1.1#4是非法的)

下面是堆栈跟踪。非常感谢任何解决此问题的人提供的帮助。

javax.xml.ws.WebServiceException: javax.xml.stream.XMLStreamException: Trying to declare prefix xmlns (illegal as per NS 1.1 #4)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:96)
        at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:236)
        at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:128)
        at com.sun.xml.xwss.XWSSClientPipe.process(XWSSClientPipe.java:123)
        at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:79)
        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:559)
        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:518)
        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:503)
        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:400)
        at com.sun.xml.ws.client.Stub.process(Stub.java:228)
        at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:167)
        at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:193)
        ...
        ...
Caused by: javax.xml.stream.XMLStreamException: Trying to declare prefix xmlns (illegal as per NS 1.1 #4)
        at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1537)
        at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1544)
        at com.ctc.wstx.sw.BaseNsStreamWriter.setPrefix(BaseNsStreamWriter.java:188)
        at com.sun.xml.ws.util.DOMUtil.writeTagWithAttributes(DOMUtil.java:157)
        at com.sun.xml.ws.util.DOMUtil.serializeNode(DOMUtil.java:103)
        at com.sun.xml.ws.util.DOMUtil.serializeNode(DOMUtil.java:124)
        at com.sun.xml.ws.message.saaj.SAAJMessage.writeTo(SAAJMessage.java:484)
        at com.sun.xml.ws.encoding.StreamSOAPCodec.encode(StreamSOAPCodec.java:93)

0 个答案:

没有答案