0

我有一个运行在上面的 echo web 服务,可以说http://localhost:8080/axis2/services/Service1。该服务只是回显一个通过函数发送给它的字符串echo()。使用上述服务(Service.wsdl)的wsdl,我(在eclipse中)生成了ServiceStub.java和ServiceCallbackHandler.java。使用这两个文件,我如何编写一个调用echo(String some_word)并接收响应的客户端?谢谢。

4

3 回答 3

2

如果您只是想测试/运行您的 Web 服务,我推荐 SOAPUI - http://www.soapui.org/

将它指向您的 WSDL,它将允许您调用您的 Web 服务方法。

于 2009-11-10T13:08:30.090 回答
0

检查Eclipse WTP 教程 - 通过 Apache Axis2 创建自下而上的 Web 服务,从第 27 步开始。

于 2009-11-03T02:50:22.620 回答
0

像这样的东西:(
另请参阅:Axis2 Web 服务(Tomcat v6)

package com.gg.ws;

import java.rmi.RemoteException;

import com.gg.ws.ServiceStub.Echo;
import com.gg.ws.ServiceStub.EchoResponse;


public class WebServiceTest {

    public void callEcho() throws RemoteException {

        ServiceStub stub = new ServiceStub();

        Echo request = new Echo();
        request.setValue("Whatever");
        EchoResponse response = stub.echo(request);
        System.out.println(" echo call   response: " + response.get_return());
    }
}
于 2009-12-27T15:38:40.683 回答