Webservice之axis
生成客户端后,直接放在自己的工程里面,直接就可以调用服务端了:如下代码
public class Test {
public static void main(String args[]){
String url = "http://localhost:8080/myaxis1/services/***Service?wsdl";
URL serviceUrl;
try {
serviceUrl = new URL(url);
***ServiceSoapBindingStub binding = (***ServiceSoapBindingStub) new ***SServiceImplServiceLocator().get***Service(serviceUrl);
UserBean user = new UserBean();
user.setAreacode("9999");
user.setCharging("");
user.setPassword("123456");
user.setTeam_id(-1);
user.setUserid("ytest");
user.setUsertype(1);
OrderBean orderbean = new OrderBean();
orderbean.setProductid("001");
OrderBean[] order =new OrderBean[]{orderbean};
ResultBean bean = binding.createUser(user, order, "20130408164312");
System.out.println("返回码:" + bean.getReturnCode()+" 返回消息:"+bean.getReturnMessage());
} catch (Exception e) {
e.printStackTrace();
}
}
}
posted on 2015-08-21 20:58 nevergiveupzeng 阅读(353) 评论(0) 编辑 收藏 举报