其他分享
首页 > 其他分享> > 客户端调用cxf发布的服务

客户端调用cxf发布的服务

作者:互联网

import java.util.ArrayList;
import java.util.List;

import javax.xml.namespace.QName;

import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;


public class Test {
    public static void main(String[] args) {
        
        
        JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
        org.apache.cxf.endpoint.Client client = dcf.createClient("http://localhost:8080/ssdr-interfacePlatform/interface/CzrkSearchWebService?wsdl");
        //Qname(命名空间,方法名)
        QName name = new QName("http://webservice.framework.platform.angle.com/","PageQuery");
        
        List t3 = new ArrayList();
        t3.add("3");
        t3.add("33");
        List t6 = new ArrayList();
        t6.add("6");
        t6.add("66");
        List t7 = new ArrayList();
        t7.add("7");
        t7.add("77");
        Object[] param = new Object[]{"1","2",t3,"4","5",t6,t7,"8",9,10};
        try {
            Object[] obj = client.invoke(name, param);
            System.out.println(obj);
        } catch (Exception e) {
            e.printStackTrace();
        }
        
    }

}

 

标签:调用,t7,List,t3,add,cxf,import,new,客户端
来源: https://www.cnblogs.com/javadongx/p/cxf_webservice.html