You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Brian Bacsu <bb...@csc.com> on 2006/09/19 18:25:25 UTC

[Axis2] Socket connection on Client and Server not disconnecting

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

Re: Axis array serialization problem (Adnene problem)

Posted by Adnene <ab...@infovista.com>.
Hi all,

 It seems that the problem I have with deserialising array of strings is
know bug:

http://issues.apache.org/jira/browse/AXIS-2485
http://issues.apache.org/jira/browse/AXIS-2485 

Did someone had a look at this problem? The bug seems not to be planned. Can
anyone help me in getting this bug solved?

Adnene
-- 
View this message in context: http://www.nabble.com/Re%3A-Axis-array-serialization-problem-%28Adnene-problem%29-tf2157136.html#a6483093
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2] Socket connection on Client and Server not disconnecting

Posted by robert lazarski <ro...@gmail.com>.
Actually, I meant attach all that to the jira:

http://issues.apache.org/jira/browse/AXIS2-935

Robert

On 9/19/06, robert lazarski <ro...@gmail.com> wrote:
>
> I think its an internal axis2 issue in that the httpclient call needs to
> invoke closeIdleConnections() . I've battled CLOSE_WAIT issues a few times
> and I think I know what's happening. If you attach your source here, and
> attach your netstat output along with how long the CLOSE_WAIT condition
> lasts, I'll try and reproduce the error and then try to fix it.
>
> Robert
>
> On 9/19/06, Brian Bacsu <bb...@csc.com> wrote:
> >
> >
> > 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" <ro...@gmail.com>*
> >
> > 09/19/2006 01:42 PM  Please respond to
> > axis-user@ws.apache.org
> >
> >   To
> > axis-user@ws.apache.org  cc
> >
> >  Subject
> > Re: [Axis2] Socket connection on Client and Server not disconnecting
> >
> >
> >
> >
> >
> >
> > 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 <bb...@csc.com> 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: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> >
>

Re: [Axis2] Socket connection on Client and Server not disconnecting

Posted by robert lazarski <ro...@gmail.com>.
I think its an internal axis2 issue in that the httpclient call needs to
invoke closeIdleConnections() . I've battled CLOSE_WAIT issues a few times
and I think I know what's happening. If you attach your source here, and
attach your netstat output along with how long the CLOSE_WAIT condition
lasts, I'll try and reproduce the error and then try to fix it.

Robert

On 9/19/06, Brian Bacsu <bb...@csc.com> wrote:
>
>
> 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" <ro...@gmail.com>*
>
> 09/19/2006 01:42 PM  Please respond to
> axis-user@ws.apache.org
>
>   To
> axis-user@ws.apache.org  cc
>
>  Subject
> Re: [Axis2] Socket connection on Client and Server not disconnecting
>
>
>
>
>
>
> 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 <bb...@csc.com> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

Re: [Axis2] Socket connection on Client and Server not disconnecting

Posted by Brian Bacsu <bb...@csc.com>.
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" <ro...@gmail.com> 
09/19/2006 01:42 PM
Please respond to
axis-user@ws.apache.org


To
axis-user@ws.apache.org
cc

Subject
Re: [Axis2] Socket connection on Client and Server not disconnecting






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 <bb...@csc.com> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



Re: [Axis2] Socket connection on Client and Server not disconnecting

Posted by robert lazarski <ro...@gmail.com>.
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 <bb...@csc.com> 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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org