xfire调用webService接口方法

来源:互联网 发布:淘宝点发布没反应 编辑:程序博客网 时间:2024/05/18 00:58

xfire调用webService接口方法
    /**
     * 获取连接对象
     */
    private static Client getClient() {
        synchronized (XXXService.class) {
            if (client == null) {
                try {
                    client = new Client(new URL("http:XXXX?wsdl"));
                } catch (Exception e1) {
                    e1.printStackTrace();
                }
            }
        }
        return client;
    }

        //        Client client = getClient();
        //        Object[] results = null;
        //        try {
        //            //调用特定的Web Service方法
        //            results = client.invoke("verifyRegister", new Object[] { idNo,
        // idType,name});
        //        } catch (Exception e) {
        //            e.printStackTrace();
        //        }
        //        if (results == null)
        //            System.out.println("zero");
        //        else{
        //         for (int i = 0; i < results.length; i++) {
        //             System.out.println(results[i].toString());
        //         }
        //        }

原创粉丝点击