RPCServiceClient-调用webservice客户端


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];
}

 

 转自:http://blog.csdn.net/fengyun111999/article/details/7517599


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM