调用wsdl格式的webServices服务 报404的错误,请问是怎么回事?
用wsdl2java工具把wsdl格式的文件编译成四个java文件,CSGateWS.java、CSGateWSLocator.java、CSGateWSPortType.java、CSGateWSStub.java(好像跟网上查到的资料不一样)。只知道调用其中的doCallBack(String s) 方法,但是只是在CSGateWSPortType.java文件中有一个接口,不知道里面如何调用。我的客户端调用如下所示:
try {
String endpoint = "http://www.ipcom2008.com/CSGateWs.wsdl";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setOperationName(new QName(
"http://www.ipcom2008.com/CSGateWs.wsdl", "doCallBack"));
call.setTargetEndpointAddress(new java.net.URL(endpoint));
String ret = (String) call.invoke(new Object[] {xml.toString()});
System.out.println("return value is " + ret);
}catch (Exception ex) {
ex.printStackTrace();
}
完全是按网上的提示做的。xml是我想传过去的xml格式的串。
但是执行的时候总是抛出下列异常:
- Servlet.service() for servlet jsp threw exception
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)Not Found
faultActor:
faultNode:
faultDetail:
{}:return code: 404
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /csgatew was not found on this server.</p>
<hr>
<address>Apache/2.0.52 (Red Hat) Server at www.ipcom2008.com Port 80</address>
</body></html>
{http://xml.apache.org/axis/}HttpErrorCode:404
(404)Not Found
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
......
请问是什么地方出的错误,谢谢!