如何使用Eclipse生成的webservice-client类? [英] How to use the webservice-client classes generated with Eclipse?
问题描述
它生成了两个包:
1 - datamodel。
2 - 客户端。
内部客户端包中有5个类:
1- ServiceName
2- ServiceNameProxy >
3- ServiceNameService
4- ServiceNameServiceLocator
5- ServiceNameSoapBindingStub
我需要知道这些是什么? AND
如何使用参数调用Web服务方法?
提前感谢
我是 / strong>新的Web服务,我不能很好地解释这些类是什么 ,但我相信你可以使用代理
class调用Web Service方法。
public class TestClient {
public static void main(String [] args ){
ServiceNameProxy proxy = new ServiceNameProxy();
proxy.setEndpoint(http:// localhost:8080 / ServiceName / asdf); //在wsdl
中定义int i = proxy.webServiceMethod(new String(),new String ());
}
}
webServiceMethod() code>将是服务中定义的方法的名称。
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
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.
这篇关于如何使用Eclipse生成的webservice-client类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!