2、利用Eclipse自动生成WebServiceclient代码容易多了:
  首先,newproject,选择other,在输入框中输入WebServiceClient,选中搜索后的结果,点击Next,在Servicedefinition中输入WebService的发布地址,点击Finish
  这样,WebServiceClient代码已经生成好了。
  接下来写一个Test类,在main函数中输入如下代码:
Stringendpoint="服务器的WebService的地址";
YourWebServiceNameProxyumsp=newYourWebServiceNameProxy(endpoint);
try{
StringresultStr=umsp.opMethod("arg0","arg1");
System.out.println(resultStr);
}catch(Exceptione){
System.out.println("异常");
e.printStackTrace();
}catch(RemoteExceptione){
System.out.println("RemoteException异常");
e.printStackTrace();
}