Java org.apache.axis2.AxisFault:第一个元素必须包含本地名称 Envelope ,但找到了 html
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2165010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
org.apache.axis2.AxisFault: First Element must contain the local name, Envelope , but found html
提问by Java Guy
What could be the reason for the following exception from Axis... Http verion used was 1.0.
Axis 出现以下异常的原因可能是什么...使用的 Http 版本是 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.
但是根据轴文档,上述属性仅适用于 HTTP 1.1 版。如果 HTTP 版本为 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)
采纳答案by Java Guy
This is was actually the server encountering an Internal 500 Error and returning a HTML respose to the client.
这实际上是服务器遇到内部 500 错误并向客户端返回 HTML 响应。
回答by Faron
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.
尝试使用 tcpmon 之类的嗅探器来查看服务的实际响应。我的猜测是客户端正在使用服务器上不存在的目标 URL,并且服务器正在响应包含 HTML 而不是 SOAP 信封的 404。
回答by apps
Tomcat server was serving an HTTP web page to indicate failure in the response to the SOAP API call.
Tomcat 服务器正在提供 HTTP 网页以指示对 SOAP API 调用的响应失败。