以axis2来说,需要对方提供AxisServiceStub类文件(就是wsdl文件),假入对方有一个ShowName的方法,现在用axis2来调用,coding 如下
//初始化Sub类
AxisServiceStub stub = new AxisServiceStub();
//传递AxisServiceStub.ShowName对象,相关参数在这边赋值。
AxisServiceStub.ShowName command = new AxisServiceStub.ShowName();
command.setName("Hello!");
//取得返回值
//String name = stub.showName(command).get_return();
System.out.println(stub.showName(command).get_return());
通过 http提供 restful服务就可以了,现在很多巨头都是这样做的,发送一个http请求过去,服务端返回json或xml回来打完收工。