如何使用Eclipse生成的webservice-client类? [英] How to use the webservice-client classes generated with Eclipse?

查看:854
本文介绍了如何使用Eclipse生成的webservice-client类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用eclipse Helios创建一个Web服务客户端,用于消费一个axis 1.4 web服务。

它生成了两个包:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆