zoukankan      html  css  js  c++  java
  • webservice客户端调用

    public static void main(String[] args) {
            try {
                String endpoint = "http://1.1.1.1:8080/cms/services/ICommonService?wsdl";
                // 直接引用远程的wsdl文件
                // 以下都是套路
                Service service = new Service();
                Call call = (Call) service.createCall();
                call.setTargetEndpointAddress(endpoint);
                // WSDL里面描述的接口名称
                call.setOperationName("serviceHb");
                // 接口的参数
                call.addParameter("nodeIndexCode",XMLType.XSD_STRING,ParameterMode.IN);
                // 设置返回类型
                call.setReturnType(XMLType.XSD_STRING);
                String temp = "测试人员";
                QName qName=new QName("http://ws.cms.is6.hk.com","serviceHb");
                String result = (String) call.invoke(qName, new Object[] {temp});
                // 给方法传递参数,并且调用方法
                System.out.println("result is " + result);
            } catch (Exception e) {
                System.err.println(e.toString());
            }
        }

  • 相关阅读:
    简单爬虫架构解析
    三种urllib实现网页下载,含cookie模拟登陆
    MySQL 从入门到删库
    Python Set
    Python dict
    Python tuple
    Python List
    死锁问题
    线程通信之生产者和消费者案例
    多线程安全和线程同步
  • 原文地址:https://www.cnblogs.com/yangxiong/p/8422612.html
Copyright © 2011-2022 走看看