Axis1.4 WebService客户端获取数据遇到的一个错误
来源:互联网 发布:无法连接到dota2网络 编辑:程序博客网 时间:2024/05/16 02:14
Axis1.4已经是很老的版本了,但是没办法,别人的Webservice是用这个发布的。在使用的过程中,遇到了一个错误,先把错误栈贴出来吧。
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 172033; XML document structures must start and end within the same entity.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 172033; XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipChar(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.sendi.logAudit.job.dataws.service.venus4AService.Venus4AServiceSoapBindingStub.resource4AOperContent(Venus4AServiceSoapBindingStub.java:548)
at com.sendi.logAudit.job.dataws.client.process.Slave4AAppLogGetProcess.process(Slave4AAppLogGetProcess.java:73)
at com.sendi.logAudit.job.dataws.web.JobTestAction$1.run(JobTestAction.java:48)
{http://xml.apache.org/axis/}hostname:logaudit48
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 172033; XML document structures must start and end within the same entity.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.sendi.logAudit.job.dataws.service.venus4AService.Venus4AServiceSoapBindingStub.resource4AOperContent(Venus4AServiceSoapBindingStub.java:548)
at com.sendi.logAudit.job.dataws.client.process.Slave4AAppLogGetProcess.process(Slave4AAppLogGetProcess.java:73)
at com.sendi.logAudit.job.dataws.web.JobTestAction$1.run(JobTestAction.java:48)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 172033; XML document structures must start and end within the same entity.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipChar(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
... 11 more
我是一个小时获取一次数据,有的时候成功,有的时候失败,失败的情况下一般就是打印这个问题了。很纳闷,由于传递的请求参数是一样的,为什么有几个小时的数据就是传递失败呢。后来还是用Google解决了这个问题。
stackoverflow上面的原话是这么说的。
Axis 1.4 knows nothing about chunks in the HTTP response and probably closes the connection before receiving all the chunks. When it attempts to deserialize the SOAP message, it complains that the XML is not well formed and is missing some closing tag, which is expected because it doesn't have the complete SOAP response.
意思是Axis1.4 用的是HTTP1.0来传递数据,不支持分块传输编码(这个我也不懂:(),可能在接收到所有的块之前关闭掉这个链接。当反序列话返回的SOAP消息的时候,会抛出XMML格式非法或者某些标签未关闭的异常,原因是没有接收到完整的SOAP响应消息。
解决方案如下。
修改axis.jar文件里的org/apache/axis/client/client-config.wsdd文件
<?xml version="1.0" encoding="UTF-8"?><deployment name="ApacheCommonsHTTPConfig" xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <globalConfiguration> <parameter name="disablePrettyXML" value="true"/> <parameter name="enableNamespacePrefixOptimization" value="false"/> </globalConfiguration> <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender" /> <transport name="local" pivot="java:org.apache.axis.transport.local.LocalSender" /> <transport name="java" pivot="java:org.apache.axis.transport.java.JavaSender" /></deployment>将里面的内容替换成上面的就OK了,这样客户端就能通过http1.1来传递参数了。
原始地址是 http://stackoverflow.com/questions/7306626/saxparseexception-xml-document-structures-must-start-and-end-within-the-same-en
- Axis1.4 WebService客户端获取数据遇到的一个错误
- 【webservice】生成axis1的webservice客户端代码
- 使用axis1.4来生成Webservice的java客户端
- 使用axis1.4生成webservice的客户端代码
- Axis1.4开发webService中遇到的问题及解决方案
- axis1.4生成webservice客户端代码
- axis1.4 客户端调用webservice接口返回错误:no SOAPAction header!
- Axis1.4 的客户端使用
- Axis1.4 快速入门 发布WebService服务端、生成WebService客户端
- 根据wsdl的url,使用axis1.4生成客户端,并且对webservice进行调用
- 根据wsdl的url,使用axis1.4生成客户端,并且对webservice进行调用
- axis1.4发布返回复杂类型的webservice服务+代码访问+客户端访问
- axis1.4发布返回复杂类型的webservice服务+代码访问+客户端访问
- 利用axis1 客户端调用cxf写的webservice接口
- 项目实例:WebService axis1.4高级编程(服务端、客户端)
- axis1.4 发布webservice的问题
- Axis1.4发布WebService
- Webservice-----------axis1.4
- C# 发送邮件内容嵌入图片
- Des 双向加密工具类
- POJ2456 Aggressive cows (二分)
- eoj1818 dijkstra求最短路及其条数
- PEP: Iterator
- Axis1.4 WebService客户端获取数据遇到的一个错误
- 图像缩放算法及速度优化之双线性插值
- Linux下常用命令总结
- C++ 标准库---移除性算法之二移除重复元素
- IntelliJ IDEA 与 JBOSS集成
- 观察者模式修改
- Hadoop二次排序的其他写法
- mongo索引小结
- 兼容Windows与Linux的写日志代码