我使用 WSDL2Java 转换器从 WSDL 生成了 Java 文件,但我不知道如何将服务与这些文件一起使用,因为没有示例。我正在实施客户端。
关于 Axis2:阅读这些链接,它们包含一些示例:
http://ws.apache.org/axis2/1_5_1/quickstartguide.html#clients http://ws.apache.org/axis2/1_5_1/quickstartguide.html#clients
http://ws.apache.org/axis2/1_0/userguide3.html http://ws.apache.org/axis2/1_0/userguide3.html
EDIT:关于Axis1:它基于JAX-RPC,您需要实例化存根对象或使用服务定位器来获取存根实例,所有WS操作都将在其中。给出一个例子here http://ws.apache.org/axis/java/user-guide.html#WSDL2JavaBuildingStubsSkeletonsAndDataTypesFromWSDL:
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);
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)