org.apache.axis2.AxisFault:第一个元素必须包含本地名称 Envelope ,但找到了 html
Axis 出现以下异常的原因可能是什么...使用的 Http 版本是 1.0。
如果设置以下属性,则可以解决此问题,
stub._getServiceClient().getOptions().
setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
Boolean.FALSE);
但根据 axis 文档,上述属性仅适用于 HTTP 版本 1.1。 如果 HTTP 版本为 1.0,则传输框架将忽略此属性。
有什么想法吗?
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:251)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:209)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:191)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
What could be the reason for the following exception from Axis... Http verion used was 1.0.
Read this could be solved if the following property is set
stub._getServiceClient().getOptions().
setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
Boolean.FALSE);
But the above property is applicable only for HTTP version 1.1 as per axis docs.
This property will be ignored by the transport framework if the HTTP version is 1.0.
Any thoughts?
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:90)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
Caused by: org.apache.axiom.soap.SOAPProcessingException: First Element must contain the local name, Envelope , but found html
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:251)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:209)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:191)
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:105)
at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试使用 tcpmon 等嗅探器来查看服务的实际响应。我的猜测是,客户端使用的目标 URL 在服务器上不存在,并且服务器使用包含 HTML 而不是 SOAP 信封的 404 进行响应。
Try using a sniffer like tcpmon to see the actual response from the service. My guess is that the client is using a target URL that does not exist on the server and the server is responding with a 404 containing HTML instead of a SOAP envelope.
这实际上是服务器遇到内部 500 错误并向客户端返回 HTML 响应。
This is was actually the server encountering an Internal 500 Error and returning a HTML respose to the client.
Tomcat 服务器正在提供 HTTP 网页以指示对 SOAP API 调用的响应失败。
Tomcat server was serving an HTTP web page to indicate failure in the response to the SOAP API call.