axis wsdl2java,如何使用Axis WSDL2Java生成的文件?

这篇博客介绍了如何在客户端实现服务调用,针对Axis2和Axis1提供了详细的步骤。对于Axis2,建议查阅相关链接中的示例;而对于Axis1,通过实例展示了如何实例化Stub对象或使用ServiceLocator获取Stub并执行Web服务操作。

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.

解决方案

Regarding Axis2: read these these links they contain some examples:

EDIT: 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);

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值