当前位置:  开发笔记 > 编程语言 > 正文

javax.xml.stream.XMLStreamException:不允许使用DOCTYPE

如何解决《javax.xml.stream.XMLStreamException:不允许使用DOCTYPE》经验,为你挑选了1个好方法。

我在使用Axis2调用.net Web服务时遇到此异常.请帮我找出解决方案.

org.apache.axis2.AxisFault: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:123)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:354)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
at com.cakemarketing.affiliates.api._2.ReportsStub.clicks(ReportsStub.java:2106)
at com.infotop.common.Test.main(Test.java:49)

Caused by: org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:276)
at org.apache.axiom.om.impl.llom.OMContainerHelper.buildNext(OMContainerHelper.java:164)
at org.apache.axiom.om.impl.llom.OMContainerHelper.getFirstOMChild(OMContainerHelper.java:182)
at org.apache.axiom.om.impl.llom.OMDocumentImpl.getFirstOMChild(OMDocumentImpl.java:201)
at org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:98)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:544)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:540)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:188)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
... 7 more
Caused by: javax.xml.stream.XMLStreamException: DOCTYPE is not allowed
at org.apache.axiom.util.stax.dialect.DisallowDoctypeDeclStreamReaderWrapper.next(DisallowDoctypeDeclStreamReaderWrapper.java:36)
at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
at org.apache.axiom.util.stax.dialect.SJSXPStreamReaderWrapper.next(SJSXPStreamReaderWrapper.java:138)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:651)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:189)
... 16 more

Andreas Veit.. 5

当来自服务器的响应包含SOAP中不允许的文档类型声明时,将触发该异常.这通常意味着服务器生成了HTML错误页面而不是SOAP响应.



1> Andreas Veit..:

当来自服务器的响应包含SOAP中不允许的文档类型声明时,将触发该异常.这通常意味着服务器生成了HTML错误页面而不是SOAP响应.

推荐阅读
个性2402852463
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有