4

Axis 出现以下异常的原因可能是什么...使用的 Http 版本是 1.0。

如果设置了以下属性,则可以解决此问题

stub._getServiceClient().getOptions().
               setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED,
Boolean.FALSE);

但根据轴文档,上述属性仅适用于 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)
4

3 回答 3

7

尝试使用像 tcpmon 这样的嗅探器来查看服务的实际响应。我的猜测是客户端正在使用服务器上不存在的目标 URL,并且服务器使用包含 HTML 而不是 SOAP 信封的 404 响应。

于 2010-02-03T11:34:53.517 回答
6

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

于 2010-02-12T22:27:07.017 回答
0

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

于 2015-05-15T03:16:28.887 回答