org.apache.axis2.AxisFault:第一个元素必须包含本地名称 Envelope ,但找到了 html

发布于 2024-08-19 19:38:49 字数 2058 浏览 6 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小…红帽 2024-08-26 19:38:49

尝试使用 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.

御弟哥哥 2024-08-26 19:38:49

这实际上是服务器遇到内部 500 错误并向客户端返回 HTML 响应。

This is was actually the server encountering an Internal 500 Error and returning a HTML respose to the client.

帅气尐潴 2024-08-26 19:38:49

Tomcat 服务器正在提供 HTTP 网页以指示对 SOAP API 调用的响应失败。

Tomcat server was serving an HTTP web page to indicate failure in the response to the SOAP API call.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文