php做的WebService用axis调用不到

07-06-05 hellohong
大家好:

公司有一个项目, 要求我用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();

}

有没有谁知道呢?

banq
2007-06-06 15:12
可能有一些特殊字符,Java对XML要求很严格。

hellohong
2007-06-07 12:23
TO:Banq

谢谢Banq老大, 我已经搞定了!

对方重新检查书写了wsdl文件!

猜你喜欢