我正在开发cxf客户端。我从wsdl生成存根并从那里开发代码。我的代码是类似的东西如何在cxf静默代码中设置属性maxConnection
URL WSDL_LOCATION = new URL(targetURL);
CustomerWS_Service CustomerWSService = new CustomerWS_Service (WSDL_LOCATION);
CustomerWS customerWS = CustomerWSService.getCustomerWSPort();
现在,我想一些属性设置为连接:
max_total_connection: maximum number of connections allowed
max_connection_per_host: maximum number of connections allowed for a given host config
一些研究告诉我在HttpURLConnection类来设置这些属性。但我不知道该怎么做,或者至少如何从代码中获得HttpUrlConnection obj。
谢谢。但我不使用异步。您的示例仅适用于异步。它是否适用于同步通话? – David
是的它适用于同步以及不要将其设置为false。 –
再次感谢。你说“只是不要把它设置为假”。你的意思是bus.setProperty(AsyncHTTPConduit.USE_ASYNC,Boolean.TRUE); – David