可以用AXIS来调用。具体例子可以搜一下,好多的。

解决方案 »

  1.   

    直接可以用wsdl文件生成客户端,如果选择axis2:代码类似:
    public void testecho() throws java.lang.Exception { /**
     * OMNamespace omNs = fac.createOMNamespace(
     * "http://MyService.example3.userguide/", "flower"); OMElement method =
     * fac.createOMElement("reserve", omNs);
     * 
     * OMElement id = fac.createOMElement("flowerid", omNs);
     * id.setText("1"); method.addChild(id);
     * 
     * 
     * 
     * 
     * 
     */
    OMFactory fac = OMAbstractFactory.getOMFactory();
    String url = "http://localhost:8080/axis2/services/MyService/";
    userguide.example3.myservice.MyServiceStub stub = new userguide.example3.myservice.MyServiceStub(
    url);
    // the default implementation should point to the right endpoint userguide.example3.myservice.types.Echo param14 = (userguide.example3.myservice.types.Echo) getTestObject(userguide.example3.myservice.types.Echo.class);
    OMNamespace omNs = fac.createOMNamespace(
    "http://MyService.example3.userguide", "flower");
    OMElement resp = fac.createOMElement("", omNs);
    param14.setElement(resp);
    stub.echo(param14);
    // todo Fill in the param14 here
    assertNotNull(stub.echo(param14));
    }