我正在開發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