php做的WebService用axis呼叫不到

hellohong發表於2007-06-05
大家好:
公司有一個專案, 要求我用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();
}
有沒有誰知道呢?

相關文章