首页 > Web开发 > 详细

调用Axis WebService异常:org.xml.sax.SAXException: Bad envelope tag: definitions

时间:2014-05-09 12:19:03      阅读:3521      评论:0      收藏:0      [点我收藏+]
用Eclipse直接创建的webservice客户端,调用webservice:
bubuko.com,布布扣
String endpoint = "XXXService?wsdl";
XXXServiceProxy proxy = new XXXServiceProxy(endpoint);
try{
    String result = proxy.request();
    System.out.println(result);
}catch(RemoteException e){
    e.printStackTrace();      
}
bubuko.com,布布扣

调用webservice出现异常:

 
Caused by: org.xml.sax.SAXException: Bad envelope tag:  definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:71)
at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1048)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
... 12 more
 
在网上找到解决办法:
String endpoind = "XXXService?wsdl";
创建endpoint的时候不能加上?wsdl,改为:
String endpoint = "XXXService";

调用Axis WebService异常:org.xml.sax.SAXException: Bad envelope tag: definitions,布布扣,bubuko.com

调用Axis WebService异常:org.xml.sax.SAXException: Bad envelope tag: definitions

原文:http://www.cnblogs.com/skyeyh/p/3708864.html

(0)
(1)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!