我正在开发 cxf 客户端。我从 wsdl 生成存根并从那里开发代码。我的代码是这样的
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。