轴 - 如何访问它?
您好,我在 web 应用程序中有轴,我可以访问 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
怎么了? 谢谢
Hi I have axis in webapp and I can access http://localhost:8080/oop/services/test2?wsdl correctly. I wrote client:
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的端点 URL 错误?
http://localhost:8080/oopfwsDB/services/test2 - 有效
http://localhost:8080/oop/servlet/AxisServlet/services/test2 - 不
Your endpount URL is wrong?
http://localhost:8080/oopfwsDB/services/test2 - works
http://localhost:8080/oop/servlet/AxisServlet/services/test2 - not