轴 - 如何访问它?

发布于 2024-07-24 10:36:04 字数 2128 浏览 7 评论 0原文

您好,我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文