Robert
Is this an issue with ServiceClient's finalizeInvoke() method not properly cleaning up the connection? Would I experience the same socket resource starvation with Axis2 if I reverted to a simpler implementation using the ServiceClient.sendReceive() method, rather than the OperationClient.execute() method?
Thanks,
Brian Bacsu
| "robert lazarski"
<[EMAIL PROTECTED]>
09/19/2006 01:42 PM
|
|
This is a known issue:
http://issues.apache.org/jira/browse/AXIS2-935
There is a patch submitted. If you could attach your test case to it
I'll take a look at the patch.
Robert
On 9/19/06, Brian Bacsu <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> We have implemented an Axis2 client to call web services exposed through
> both .NET and Axis1 running on Microsoft Server 2003. I have encountered an
> issue with the Axis2 client with regard to disconnecting the client and
> server socket connections. The server-side connection will finally time-out
> and drop (It looks like Microsoft Server will hang onto connections for 60
> seconds, even after close requested), but the client side connections
> continue to collect until the server begins to run out of
> resources/connections. The client connections show CLOSE_WAIT status when
> viewed with netstat .
>
> Any suggestions would be appreciated.
>
> Here is a sample of the client code:
>
> Options options = new Options();
>
>
> options.setExceptionToBeThrownOnSOAPFault(Boolean.TRUE);
>
> options.setTo(new EndpointReference(url.toString()));
> ServiceClient serviceClient = null;
> MessageContext requestContext =
> CFWsoapClient.getMessageContext(OM_Msg,this,soapRoot, logger, traceLevel);
> requestContext.setSoapAction(action);
> try {
>
> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
> options.setProperty(HTTPConstants.SO_TIMEOUT,1000);
> options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
> Boolean.FALSE);
>
> options.setProperty(HTTPConstants.CONNECTION_TIMEOUT,
> (int)timeout);
>
> serviceClient = new ServiceClient();
> serviceClient.setOptions(options);
> OperationClient opClient =
> serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
> opClient.addMessageContext(requestContext);
> opClient.execute(true);
>
> MessageContext resultContext =
> opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
>
> SOAPEnvelope resEnvelope = resultContext.getEnvelope();
> SOAPBody body = resEnvelope.getBody();
>
> opClient.complete(resultContext);
> return body;
> }
> catch (AxisFault e1) {
> e1.printStackTrace();
> throw new AxisFault(e1.getMessage());
> }
> finally {
> try {
> serviceClient.finalizeInvoke();
> } catch (AxisFault axisFault) {
> logger.error(axisFault.getMessage() +
> axisFault.toString());
> } catch (Exception e) {
> logger.error(e.getMessage() + e.toString());
> }
>
> }
>
> Thanks,
>
> Brian Bacsu
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
