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

Reply via email to