码迷,mamicode.com
首页 > Web开发 > 详细

RPCServiceClient-调用webservice客户端

时间:2015-09-22 18:06:29      阅读:207      评论:0      收藏:0      [点我收藏+]

标签:

import javax.xml.namespace.QName;

import org.apache.axis2.AxisFault;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.rpc.client.RPCServiceClient;

 

public void callRemoteFun(){
  RPCServiceClient client = null;
  try {
   client = new RPCServiceClient();
   Options options = client.getOptions(); 
   // 创建一个远程的访问地址  
   EndpointReference target = new EndpointReference("http://...");
            options.setTo(target);
  } catch (AxisFault e) {
   e.printStackTrace();
  }
  Object[] objargs = new Object[] {"001","1.00","3","123456","5"};
  Class[] getobj = new Class[] { String.class };
  Object[] response = client.invokeBlocking(new QName("{SERVICE_NAMESPACE}", "{serviceName}"),  
                objargs,getobj);  
  String result = (String) response[0];
 }

 

RPCServiceClient-调用webservice客户端

标签:

原文地址:http://www.cnblogs.com/chyg/p/4829475.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!