zoukankan      html  css  js  c++  java
  • 根据第三方提供的webservice地址获取文件信息

    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    
    import javax.xml.rpc.ParameterMode;
    
    /**
     * webservice 调取帮助类
     *
     * @author baizhanshi on 2018/5/2.
     */
    public class WebServiceUtil {
    
    
        /**
         * 根据远程提供第三方地址获取返回的调听录音url
         *
         * @param url          第三方地址
         * @param EnterpriseID 企业编号
         * @param user         坐席号
         * @param password     坐席密码
         * @param SessionID    会话编号
         * @return
         */
        public static String getResponseResult(String url, String EnterpriseID, String user, String password, String SessionID) {
            try {
                String endpoint = url;
                // 直接引用远程的wsdl文件
                // 以下都是套路
                Service service = new Service();
                Call call = (Call) service.createCall();
                call.setTargetEndpointAddress(endpoint);
                call.setOperationName("queryRecordAddr");// WSDL里面描述的接口名称
                call.addParameter("EnterpriseID",
                        XMLType.XSD_STRING,
                        ParameterMode.IN);// 接口的参数
                call.addParameter("USER",
                        XMLType.XSD_STRING,
                        ParameterMode.IN);// 接口的参数
                call.addParameter("PASSWORD",
                        XMLType.XSD_STRING,
                        ParameterMode.IN);// 接口的参数
                call.addParameter("SessionID",
                        XMLType.XSD_STRING,
                        ParameterMode.IN);// 接口的参数
                call.setReturnType(XMLType.XSD_STRING);// 设置返回类型
    
                String result = (String) call.invoke(new Object[]{EnterpriseID, user, password, SessionID});
                // 给方法传递参数,并且调用方法
                return result;
            } catch (Exception e) {
                return e.getMessage();
            }
        }
    }
    

      参考博客:https://blog.csdn.net/qq_35124535/article/details/62226585

  • 相关阅读:
    win10 uwp 获得缩略图
    win10 uwp 获取指定的文件 AQS
    win10 uwp 使用 Geometry resources 在 xaml
    WPF 如何画出1像素的线
    Windows 10 快捷键汇总表格
    要让CLR挂掉的话……
    UWP 分享用那个图标
    UWP 分享用那个图标
    PHP jdtogregorian() 函数
    PHP jdtojewish() 函数
  • 原文地址:https://www.cnblogs.com/baizhanshi/p/8981717.html
Copyright © 2011-2022 走看看