如何使用Axis WSDL2Java生成的文件? [英] How to use Axis WSDL2Java generated files?
问题描述
我使用WSDL2Java转换器从WSDL生成Java文件,但我不知道如何使用这些文件的服务,因为没有示例。我正在实现客户端。
I generated Java files from WSDL with WSDL2Java converter, but I don't know how can I use service with these files, because there are no examples. I'm implementing client side.
推荐答案
关于Axis2:请阅读这些链接,它们包含一些示例:
Regarding Axis2: read these these links they contain some examples:
http://ws.apache.org/ axis2 / 1_5_1 / quickstartguide.html#clients
http ://ws.apache.org/axis2/1_0/userguide3.html
编辑:关于Axis1:它基于在JAX-RPC上,您需要实例化存根对象或使用服务定位器来获取存根实例,并且所有WS操作都将在其中。举例此处:
Regarding Axis1: it is based on JAX-RPC and you need to instantiate stub object or use service locator to get stub instance and all WS operations will be in that. An example is given here:
public class Tester {
public static void main(String [] args) throws Exception {
// Make a service
AddressBookService service = new AddressBookServiceLocator();
// Now use the service to get a stub which implements the SDI.
AddressBook port = service.getAddressBook();
// Make the actual call
Address address = new Address(...);
port.addEntry("Russell Butek", address);
}
}
这篇关于如何使用Axis WSDL2Java生成的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!