java 轴 - 如何访问它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1006190/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
axis - how to access it?
提问by
Hi I have axis in webapp and I can access http://localhost:8080/oop/services/test2?wsdlcorrectly. I wrote client:
嗨,我在 webapp 中有轴,我可以正确访问http://localhost:8080/oop/services/test2?wsdl。我写客户端:
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class TestClient {
public static void main(String [] args) {
try {
String endpoint =
"http://localhost:8080/oop/servlet/AxisServlet/services/test2";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://ws.oopf.com/testclient", "fce"));
String ret = (String) call.invoke( new Object[] { "Hello!" } );
System.out.println("Sent 'Hello!', got '" + ret + "'");
} catch (Exception e) {
System.err.println(e.toString());
}
}
}
I receive
AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (404)/WEB-INF/tiles/commons/404.jsp
faultActor:
faultNode:
faultDetail:
{}:return code: 404
{http://xml.apache.org/axis/}HttpErrorCode:404
(404)/WEB-INF/tiles/commons/404.jsp
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at TestClient.main(TestClient.java:19)
(404)/WEB-INF/tiles/commons/404.jsp
What is wrong? thanks
怎么了?谢谢
采纳答案by akarnokd
Your endpount URL is wrong?
您的端点 URL 错误?
http://localhost:8080/oopfwsDB/services/test2- works http://localhost:8080/oop/servlet/AxisServlet/services/test2- not
http://localhost:8080/oopfwsDB/services/test2- 有效 http://localhost:8080/oop/servlet/AxisServlet/services/test2- 不

