如何建立Java Project访问远程Web Service的哦?步骤是什么哦?  

解决方案 »

  1.   

    谁能说说访问远程Web Service的步骤啊,或者是给个例子也行啊   谢谢咯 
      

  2.   

    我是写WEB SERVICES的 
    JAVA访问WEB SERVICES这么写吧
    class TestWebService { static void test(String module,String content) {
    long s = System.currentTimeMillis();
    try {
    String endpoint = "http://localhost:8080/XX/services/WebServicesCenter?wsdl";
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    QName qName = new QName("http://webservice.aa.xx.com",
    "callWebService");
    call.setOperationName(qName);
    call.addParameter("module",
    org.apache.axis.encoding.XMLType.XSD_STRING,
    javax.xml.rpc.ParameterMode.IN);
    call.addParameter("content",
    org.apache.axis.encoding.XMLType.XSD_STRING,
    javax.xml.rpc.ParameterMode.IN);
    call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
    call.setUseSOAPAction(true);
    call.setSOAPActionURI("http://localhost:8080/XX/callWebService");
    String result = (String)call.invoke(new Object[]{module,content});
    System.out.println(function + " result is "+result);
    System.out.println(System.currentTimeMillis()-s+"MS");
    }
    catch (Exception e) {
    System.err.println(e.toString());
    }
    }
    再一个方法调用这个类的这个方法就行了
      

  3.   

    你到goolge上搜一下,应该有很多呀。
      

  4.   

    MyEclipse提供的客户端不太好用哦 老是提示错误 (⊙o⊙)
      

  5.   

    RMI???Remote Method Invocation远程对象方法调用??