zoukankan      html  css  js  c++  java
  • java使用axis2调用.net webservice接口

    /**
    * 测试 异常笔数,退费处理
    * @return
    */
    public static String refundHandle() {
    LogUtil.info("===============调用退费接口开始=================");
    try {

    PropertiesUtil propUtil = new PropertiesUtil("RefundInf.properties");
    Properties pros = propUtil.getProperties();
    String webServiceURL = pros.getProperty("webServiceURL");
    String actionStr = pros.getProperty("actionStr");
    String actionName = pros.getProperty("actionName");

    RPCServiceClient ser = new RPCServiceClient ();
    Options options = ser.getOptions();

    // 指定调用WebService的URL
    // EndpointReference targetEPR = new EndpointReference("http://172.16.28.100:8089/PayAPICall.asmx");
    EndpointReference targetEPR = new EndpointReference(webServiceURL);
    options.setTo(targetEPR);
    //options.setAction("命名空间/WS 方法名");
    // options.setAction("http://www.hwsoft.com/RefundCallService");
    options.setAction(actionStr);

    // 指定sfexpressService方法的参数值
    Object[] opAddEntryArgs = new Object[] { "test"};
    // 指定sfexpressService方法返回值的数据类型的Class对象
    Class[] classes = new Class[] { String.class };
    // 指定要调用的sfexpressService方法及WSDL文件的命名空间
    // QName opAddEntry = new QName("http://www.hwsoft.com/RefundCallService/","RefundCallService");
    QName opAddEntry = new QName(actionStr+"/",actionName);
    // 调用sfexpressService方法并输出该方法的返回值
    Object[] str = ser.invokeBlocking(opAddEntry, opAddEntryArgs, classes);
    String sss = str[0].toString();
    LogUtil.info("===============调用退费接口成功================="+sss);
    return sss;
    } catch (AxisFault e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    LogUtil.info("===============调用退费接口出错================="+e.getMessage());
    }
    return null;
    }

  • 相关阅读:
    《中小学生Python编程入门指南》1.1 什么是编程
    《中小学生Python编程入门指南》前言
    简单的番茄工作法倒计时(源码)
    关于AE
    Blender2.5快捷键
    关于Blender
    随意设置控件每一个角的倒角
    关于多个block问题
    UICollectionViewCell--查找cell上的按钮点击后,对应的是哪个cell
    UIMenuItem
  • 原文地址:https://www.cnblogs.com/bzsz-quan/p/9380674.html
Copyright © 2011-2022 走看看