• 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

  • 相关阅读:
    windows下搭建hadoopproject(一)
    inspect模块---检查活动对象
    Python的datetime模块分析
    深入理解python之self
    request payload
    计算机基础知识
    pycharm常用快捷键
    英语学习五大法则
    基础语法
    英语基本语法
  • 原文地址:https://www.cnblogs.com/52xuanxuan/p/6726161.html
Copyright © 2020-2023  润新知