importjava.util.Random;importjava.util.concurrent.ArrayBlockingQueue;importjava.util.concurrent.ThreadPoolExecutor;importjava.util.concurrent.TimeUnit;importorg.apache.cxf.endpoint.Client;importorg.apache.cxf.endpoint.dynamic.DynamicClientFactory;importorg.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;importorg.apache.cxf.transport.http.HTTPConduit;importorg.apache.cxf.transports.http.configuration.HTTPClientPolicy;public classWSClient {public static void main(String[] args) throwsException {
String wsdlUrl= "http://10.35.180.55:18090/services/OpenService?wsdl";//动态调用的客户端工厂类
DynamicClientFactory dcf =JaxWsDynamicClientFactory.newInstance();final Client client =dcf.createClient(wsdlUrl);//设置超时单位为毫秒
HTTPConduit conduit =(HTTPConduit)client.getConduit();
HTTPClientPolicy policy= newHTTPClientPolicy();
policy.setConnectionTimeout(15000);
policy.setAllow