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

元气小坏坏 提交于 2019-12-30 02:01:28

问题


I used eclipse Helios to create a Web Service Client for consuming an axis 1.4 web service.
It generated 2 packages:
1 - datamodel.
2 - client.

Inside client package there are 5 classes:
1- ServiceName
2- ServiceNameProxy
3- ServiceNameService
4- ServiceNameServiceLocator
5- ServiceNameSoapBindingStub

I need to Know what are these ? AND
How to call the web service methods with parameters?

Thanks in advance


回答1:


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.

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.



来源:https://stackoverflow.com/questions/4145326/how-to-use-the-webservice-client-classes-generated-with-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!