1234567891011121314151617181920 |
- package camel.demo.api7.processor;
- import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
- /**
- * @author HZY
- * @vsrsion 1.0
- * Created at 2017/4/20.
- */
- public class TestClient {
- public static void main(String args[]) throws Exception{
- JaxWsDynamicClientFactory dcf =JaxWsDynamicClientFactory.newInstance();
- org.apache.cxf.endpoint.Client client =dcf.createClient("http://192.168.131.101:3333/soap/ws?wsdl");
- //getUser 为接口中定义的方法名称 张三为传递的参数 返回一个Object数组
- Object[] objects=client.invoke("test");
- //输出调用结果
- System.out.println("*****"+objects[0].toString());
- }
- }
|