CXF实现WebService动态调用。

JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient(wsdlUrl);
	    
HTTPConduit conduit = (HTTPConduit) client.getConduit();
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();        
httpClientPolicy.setConnectionTimeout(2000);  //连接超时      
httpClientPolicy.setAllowChunking(false);    //取消块编码   
httpClientPolicy.setReceiveTimeout(120000);     //响应超时  
conduit.setClient(httpClientPolicy);  
	    
client.getOutInterceptors().addAll(interceptors);//设置拦截器
client.invoke(operationName, params)




你可能感兴趣的:(webservice)