Axsi2Client端sub方式访问
1)解压axis2的bin压缩包,在bin目录下找到wsdl2java.bat文件
2)在当前目录下,新建bat文件,文件内容是:
wsdl2java -uri http://10.0.10.209:9000/platform/services/BookService?wsdl -p client -s -o stub
3)运行bat文件,生成stub客户端
public class StubNormal {public static void main(String[] args) throws AxisFault {// 初始化Sub类BookServiceStub stub = new BookServiceStub();try {// 取得返回值BookServiceStub.Find find = new BookServiceStub.Find();Integer faa = stub.find(find).get_return();System.out.println(faa + "=========");// 传递AxisServiceStub.ShowName对象,相关参数在这边赋值。BookServiceStub.Ooooo command = new BookServiceStub.Ooooo();command.setIsbn("Hello!");String aa = stub.ooooo(command).get_return();System.out.println(aa + "========="); BookServiceStub.FindBook fbook = new BookServiceStub.FindBook ();BookServiceStub.Book b = new BookServiceStub.Book();b.setName("This is book!"); b.setISBN("1234-2234-3234-4234");fbook.setBook(b);BookServiceStub.Book rebook =stub.findBook(fbook).get_return();System.out.println(rebook.getISBN() + "========="+rebook.getName());} catch (Exception e) {e.printStackTrace();}}}