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 "Meeusen, Christopher W." <Me...@mayo.edu> on 2010/07/19 16:45:44 UTC

Specifying client timeout?

Hi,

 

I've got what I hope is an easy question, but I haven't been able to
find much on it through google....

 

I've got some web service stubs that I've generated from wsdl2java using
adb as the databinding.  I want to explicitly specify a timeout value
for the remote call.  How do I do that?  I've looked through the docs
here:

 

http://www.docjar.com/docs/api/org/apache/axis2/client/Stub.html#_setSer
viceClient(ServiceClient)

 

using axis2-1.5.1

 

Thanks!

Chris


Re: Specifying client timeout?

Posted by "Meeusen, Christopher W." <Me...@mayo.edu>.
Great!!!

Thanks!

On Jul 19, 2010, at 9:59, "rahul yadav" <ra...@gmail.com> wrote:

>
>     stub._getServiceClient().getOptions().setTimeOutInMilliSeconds 
> (_ws.__EvipSvrService_timeout);
>
>
>
> On Mon, Jul 19, 2010 at 8:15 PM, Meeusen, Christopher W. <Meeusen.Christopher@mayo.edu 
> > wrote:
> Hi,
>
>
>
> I’ve got what I hope is an easy question, but I haven’t been able  
> to find much on it through google….
>
>
>
> I’ve got some web service stubs that I’ve generated from  
> wsdl2java using adb as the databinding.  I want to explicitly specif 
> y a timeout value for the remote call.  How do I do that?  I’ve look 
> ed through the docs here:
>
>
>
> http://www.docjar.com/docs/api/org/apache/axis2/client/Stub.html#_setServiceClient(ServiceClient)
>
>
>
> using axis2-1.5.1
>
>
>
> Thanks!
>
> Chris
>
>

Re: Specifying client timeout?

Posted by rahul yadav <ra...@gmail.com>.
stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(_ws.__EvipSvrService_timeout);



On Mon, Jul 19, 2010 at 8:15 PM, Meeusen, Christopher W. <
Meeusen.Christopher@mayo.edu> wrote:

> Hi,
>
>
>
> I’ve got what I hope is an easy question, but I haven’t been able to find
> much on it through google….
>
>
>
> I’ve got some web service stubs that I’ve generated from wsdl2java using
> adb as the databinding.  I want to explicitly specify a timeout value for
> the remote call.  How do I do that?  I’ve looked through the docs here:
>
>
>
>
> http://www.docjar.com/docs/api/org/apache/axis2/client/Stub.html#_setServiceClient(ServiceClient)<http://www.docjar.com/docs/api/org/apache/axis2/client/Stub.html#_setServiceClient%28ServiceClient%29>
>
>
>
> using axis2-1.5.1
>
>
>
> Thanks!
>
> Chris
>

RE: Specifying client timeout?

Posted by Christian Gosch <ch...@inovex.de>.
In the generated „Stub“ class, there should be a method for every
operation of the service.

 

Each of these methods follows a simple stereotype as you will see by
code inspection.

 

Just between preparing the SOAP headers and execution of the actual
operation, you can set some arbitrary options for the call to execute.
Timeout is prepared like this:

 

Generated part:

        //adding SOAP soap_headers

         _serviceClient.addHeadersToEnvelope(env);

        // set the message context with that soap envelope

        _messageContext.setEnvelope(env);

 

        // add the message contxt to the operation client

        _operationClient.addMessageContext(_messageContext);

        

Patched part:

        // set HTTPClient SO_TIMEOUT to limit wait_for_response time: 

        // Default value = 30000 [ms]

        addPropertyToOperationClient(_operationClient,
HTTPConstants.SO_TIMEOUT, 30000);

        

        // log current properties

        System.out.println(

            this.getClass() 

            + ".operate() before _operationClient.execute(true):
_operationClient.getOptions().getProperties() == " 

            + _operationClient.getOptions().getProperties());

 

Generated part continued:

        //execute the operation client

        _operationClient.execute(true);

 

If you want to set other options, browse the API doc starting from the
appPropertyToOperationClient() method.

 

hth,

Christian

 

  _____  

From: Meeusen, Christopher W. [mailto:Meeusen.Christopher@mayo.edu] 
Sent: Monday, July 19, 2010 4:46 PM
To: axis-user@ws.apache.org
Subject: Specifying client timeout?

 

Hi,

 

I’ve got what I hope is an easy question, but I haven’t been able to
find much on it through google….

 

I’ve got some web service stubs that I’ve generated from wsdl2java using
adb as the databinding.  I want to explicitly specify a timeout value
for the remote call.  How do I do that?  I’ve looked through the docs
here:

 

http://www.docjar.com/docs/api/org/apache/axis2/client/Stub.html#_setSer
viceClient(ServiceClient)

 

using axis2-1.5.1

 

Thanks!

Chris

!DSPAM:4c44653d17328841871699!