简体   繁体   English

如何使用Eclipse生成的webservice-client类?

[英]How to use the webservice-client classes generated with Eclipse?

I used eclipse Helios to create a Web Service Client for consuming an axis 1.4 web service. 我使用eclipse Helios创建了一个Web服务客户端,用于使用轴1.4 Web服务。
It generated 2 packages: 它生成了2个包:
1 - datamodel. 1 - 数据模型。
2 - client. 2 - 客户。

Inside client package there are 5 classes: 内部客户端包有5个类:
1- ServiceName 1- ServiceName
2- ServiceNameProxy 2- ServiceNameProxy
3- ServiceNameService 3- ServiceNameService
4- ServiceNameServiceLocator 4- ServiceNameServiceLocator
5- ServiceNameSoapBindingStub 5- ServiceNameSoapBindingStub

I need to Know what are these ? 我需要知道这些是什么? AND
How to call the web service methods with parameters? 如何使用参数调用Web服务方法?

Thanks in advance 提前致谢

I am very new to Web Services and I can't give a good explanation of what those classes are, but, I believe you can use the Proxy class to call the Web Service methods. 新的Web服务,我不能让公众知道这些类是一个很好的解释,但是,我相信你可以使用Proxy类来调用Web服务方法。

public class TestClient{
    public static void main(String []args){
        ServiceNameProxy proxy = new ServiceNameProxy();
        proxy.setEndpoint("http://localhost:8080/ServiceName/asdf");//defined in wsdl

        int i = proxy.webServiceMethod(new String(), new String());
    }
}

webServiceMethod() would be whatever the name of the method is defined in the service. webServiceMethod()将是服务中定义的方法名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM