php做的WebService用axis呼叫不到
大家好:
公司有一個專案, 要求我用java呼叫php做的webService, 我用axis來呼叫, 每次都丟擲異常!
異常如下:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Bad envelope tag: definitions
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:109)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.gc.test.LuKeTest.main(LuKeTest.java:24)
org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.gc.test.LuKeTest.main(LuKeTest.java:24)
Caused by: org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:109)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
救命啊!
我調得頭都大了!
我的程式碼如下:
try {
String endPoint = "http://218.75.110.91/music/huawei/Telin_ContentSync_Service.wsdl";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
URL url = new URL(endPoint);
call.setOperationName("calltest");
call.setTargetEndpointAddress(url);
String ret = (String) call.invoke(new Object[] { "abc" });
System.out.println("return value is " + ret);
} catch (Exception ex) {
ex.printStackTrace();
}
有沒有誰知道呢?
公司有一個專案, 要求我用java呼叫php做的webService, 我用axis來呼叫, 每次都丟擲異常!
異常如下:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXException: Bad envelope tag: definitions
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:109)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
at org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XMLDocumentScanner.java:949)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.gc.test.LuKeTest.main(LuKeTest.java:24)
org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.AxisFault.makeFault(AxisFault.java:129)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:543)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at com.gc.test.LuKeTest.main(LuKeTest.java:24)
Caused by: org.xml.sax.SAXException: Bad envelope tag: definitions
at org.apache.axis.message.EnvelopeBuilder.startElement(EnvelopeBuilder.java:109)
at org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:976)
at org.apache.xerces.parsers.SAXParser.startElement(SAXParser.java:1376)
at org.apache.xerces.validators.common.XMLValidator.callStartElement(XMLValidator.java:1284)
at org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanner.java:1806)
救命啊!
我調得頭都大了!
我的程式碼如下:
try {
String endPoint = "http://218.75.110.91/music/huawei/Telin_ContentSync_Service.wsdl";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
URL url = new URL(endPoint);
call.setOperationName("calltest");
call.setTargetEndpointAddress(url);
String ret = (String) call.invoke(new Object[] { "abc" });
System.out.println("return value is " + ret);
} catch (Exception ex) {
ex.printStackTrace();
}
有沒有誰知道呢?
相關文章
- Axis2呼叫WebServiceWeb
- Webservice呼叫方式:axis,soap詳解Web
- axis2 WebService的釋出與呼叫Web
- webService 客戶端呼叫 axis2Web客戶端
- java使用axis 呼叫WCF webservice問題請教JavaWeb
- PHP呼叫Webservice例項PHPWeb
- php呼叫webservice的幾種方法PHPWeb
- WebService框架大比較(Axis,axis2,Xfire以及cxf)Web框架
- Java呼叫使用SSL/HTTPS協議來傳輸的axis webservice服務JavaHTTP協議Web
- PHP使用SOAP呼叫.net的WebService資料PHPWeb
- 【轉載】webservice框架xfire和axis的比較Web框架
- Eclipse+Tomcat+Axis2配置webservice。EclipseTomcatWeb
- webservice介面呼叫Web
- 一種WebService的呼叫方式Web
- Ajax呼叫WebService(一)Web
- C#呼叫webserviceC#Web
- webservice中呼叫structWebStruct
- js 呼叫 WebService 方法JSWeb
- PHP呼叫webservice遇到 Soap WSDL Error - "failed to load external entityPHPWebErrorAI
- java動態呼叫webserviceJavaWeb
- 新增webservice呼叫日誌Web
- webapi建立和呼叫WebServiceWebAPI
- 【原創】WebService大講堂之Axis2(7):將Spring的裝配JavaBean釋出成WebServiceWebSpringJavaBean
- 用WebService呼叫第三方天氣介面Web
- 【原創】WebService大講堂之Axis2(3):使用services.xml檔案釋出WebServiceWebXML
- php中用來可以做非同步呼叫的程式碼PHP非同步
- 【知識積累】伺服器端獲取客戶端的IP地址(當客戶端呼叫由Axis開發的WebService)伺服器客戶端Web
- tomcat + axis,webservice釋出失敗,哪位碰到過這樣的問題!TomcatWeb
- 騰訊WebService Api 跨域呼叫WebAPI跨域
- C#動態呼叫webserviceC#Web
- Android呼叫WebService詳解AndroidWeb
- xfire 客戶端呼叫webservice的問題客戶端Web
- VB中呼叫WebService上的函式的方法Web函式
- WebService系列之Axis Https(SSL)證書校驗錯誤處理方法WebHTTP
- 【原創】WebService(Axis2)視訊教程與QQ交流群釋出Web
- WebService大講堂之Axis2(6):跨服務會話(Session)管理Web會話Session
- webservice返回值是一個complextype,怎麼用java呼叫。WebJava
- Android平臺呼叫WebService詳解AndroidWeb