AxisFaultfaultCode:{http://schemas.xmlsoap.org/soap/envelope/}Server.userExceptionfaultSubcode:faultString:org.xml.sax.SAXException:Badenvelopetag:definitionsfaultActor:f...
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
上面是报的错误,我在网上查了下 说是 地址不加 ?wsdl 就可以了
String endpoint = "http://localhost/phpserver/index.php/site/quote";
Service service = new Service();
Call call;
try {
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(endpoint));
call.setOperationName("hello");
String param = new String("安迪".getBytes(), "ISO-8859-1");//如果没有加这段,中文参数将会乱码
//String param = new String("中文");
String s = (String) call.invoke(new Object[]{param});
s = new String(s.getBytes("ISO-8859-1"));//如果没有转换编码,中文也会乱码
System.out.println(s);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
去掉之后还是报错,请高手帮忙
展开