You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by acmclellen <cm...@gmail.com> on 2008/01/23 14:45:29 UTC

axis2 client timeout even with timeouts set to 0

Hi,

My client initialization code is as below, and on submitting a request to
the web service, it still times-out after 15 seconds. Please help!!

Thank you.
Regards,
Craig

=========begin=========
MultiThreadedHttpConnectionManager manager =
	new MultiThreadedHttpConnectionManager();                    
HttpConnectionManagerParams params = manager.getParams();
params.setSoTimeout(0);
params.setConnectionTimeout(0);
manager.setParams(params);
                    
HttpClientParams p = new HttpClientParams();
p.setSoTimeout(0);
p.setConnectionManagerTimeout(0);

HttpClient httpClient = new HttpClient(p, manager);
Options options;
options = serviceClient.getOptions();
options.setProperty(
	HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
options.setProperty(
	HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
                    
options.setTimeOutInMilliSeconds(0);
options.setCallTransportCleanup(true);

=========end=========
-- 
View this message in context: http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15041918.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


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


Re: axis2 client timeout even with timeouts set to 0

Posted by acmclellen <cm...@gmail.com>.
Hi Upul,

Thanks for your reply. If that was the case, I don't understand why then the
junit test and web app implementations timeout when they should, just not
the Axis2 web service.

Thanks,
Craig



Upul Godage wrote:
> 
> I think there may be a TCP connection timeout at the operating system
> level
> that cannot be controlled by Java.
> 
> Upul
> 
> 
> On Jan 28, 2008 10:08 AM, acmclellen <cm...@gmail.com> wrote:
> 
>>
>> Hi Saminda,
>>
>> I had already tried that, and that didn't work either. I'm trying to run
>> an
>> axis2 client within and axis2 webservice, and for some reason, the
>> timeout
>> I'm specifying isn't being registered. I resorted to the code below as I
>> had
>> tried everything else including what you have just proposed I do. I've
>> tried
>> running the client from a normal web app and that worked as well as
>> within
>> a
>> junit test, which worked too. So it has to be because it's an axis2
>> webservice.
>>
>> Thanks.
>> Cheers,
>> Craig
>>
>>
>>
>>
>> Saminda Abeyruwan-3 wrote:
>> >
>> > Hi,
>> >
>> > All you have to do is, set
>> > options.setTimeOutInMilliSeconds(1000000);
>> >
>> > in the client code. You don't have to go into internals of HTTPClient.
>> > Once
>> > set it like prior, this will automatically configure the httpclien.
>> >
>> > If you need set timeout to be indefinite; then set
>> > options.setTimeOutInMilliSeconds(-1);  but I wouldn't recommend this.
>> >
>> > Thank you
>> >
>> > Saminda
>> >
>> > On Jan 23, 2008 7:15 PM, acmclellen <cm...@gmail.com> wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> My client initialization code is as below, and on submitting a request
>> to
>> >> the web service, it still times-out after 15 seconds. Please help!!
>> >>
>> >> Thank you.
>> >> Regards,
>> >> Craig
>> >>
>> >> =========begin=========
>> >> MultiThreadedHttpConnectionManager manager =
>> >>        new MultiThreadedHttpConnectionManager();
>> >> HttpConnectionManagerParams params = manager.getParams();
>> >> params.setSoTimeout(0);
>> >> params.setConnectionTimeout(0);
>> >> manager.setParams(params);
>> >>
>> >> HttpClientParams p = new HttpClientParams();
>> >> p.setSoTimeout(0);
>> >> p.setConnectionManagerTimeout(0);
>> >>
>> >> HttpClient httpClient = new HttpClient(p, manager);
>> >> Options options;
>> >> options = serviceClient.getOptions();
>> >> options.setProperty(
>> >>        HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
>> >> options.setProperty(
>> >>        HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
>> >>
>> >> options.setTimeOutInMilliSeconds(0);
>> >> options.setCallTransportCleanup(true);
>> >>
>> >> =========end=========
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15041918.html
>> >> Sent from the Axis - Dev mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>> >> For additional commands, e-mail: axis-dev-help@ws.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Saminda Abeyruwan
>> >
>> > Senior Software Engineer
>> > WSO2 Inc. - www.wso2.org
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15128266.html
>> Sent from the Axis - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15128559.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


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


Re: axis2 client timeout even with timeouts set to 0

Posted by Upul Godage <up...@gmail.com>.
I think there may be a TCP connection timeout at the operating system level
that cannot be controlled by Java.

Upul


On Jan 28, 2008 10:08 AM, acmclellen <cm...@gmail.com> wrote:

>
> Hi Saminda,
>
> I had already tried that, and that didn't work either. I'm trying to run
> an
> axis2 client within and axis2 webservice, and for some reason, the timeout
> I'm specifying isn't being registered. I resorted to the code below as I
> had
> tried everything else including what you have just proposed I do. I've
> tried
> running the client from a normal web app and that worked as well as within
> a
> junit test, which worked too. So it has to be because it's an axis2
> webservice.
>
> Thanks.
> Cheers,
> Craig
>
>
>
>
> Saminda Abeyruwan-3 wrote:
> >
> > Hi,
> >
> > All you have to do is, set
> > options.setTimeOutInMilliSeconds(1000000);
> >
> > in the client code. You don't have to go into internals of HTTPClient.
> > Once
> > set it like prior, this will automatically configure the httpclien.
> >
> > If you need set timeout to be indefinite; then set
> > options.setTimeOutInMilliSeconds(-1);  but I wouldn't recommend this.
> >
> > Thank you
> >
> > Saminda
> >
> > On Jan 23, 2008 7:15 PM, acmclellen <cm...@gmail.com> wrote:
> >
> >>
> >> Hi,
> >>
> >> My client initialization code is as below, and on submitting a request
> to
> >> the web service, it still times-out after 15 seconds. Please help!!
> >>
> >> Thank you.
> >> Regards,
> >> Craig
> >>
> >> =========begin=========
> >> MultiThreadedHttpConnectionManager manager =
> >>        new MultiThreadedHttpConnectionManager();
> >> HttpConnectionManagerParams params = manager.getParams();
> >> params.setSoTimeout(0);
> >> params.setConnectionTimeout(0);
> >> manager.setParams(params);
> >>
> >> HttpClientParams p = new HttpClientParams();
> >> p.setSoTimeout(0);
> >> p.setConnectionManagerTimeout(0);
> >>
> >> HttpClient httpClient = new HttpClient(p, manager);
> >> Options options;
> >> options = serviceClient.getOptions();
> >> options.setProperty(
> >>        HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
> >> options.setProperty(
> >>        HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
> >>
> >> options.setTimeOutInMilliSeconds(0);
> >> options.setCallTransportCleanup(true);
> >>
> >> =========end=========
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15041918.html
> >> Sent from the Axis - Dev mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> >> For additional commands, e-mail: axis-dev-help@ws.apache.org
> >>
> >>
> >
> >
> > --
> > Saminda Abeyruwan
> >
> > Senior Software Engineer
> > WSO2 Inc. - www.wso2.org
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15128266.html
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>

Re: axis2 client timeout even with timeouts set to 0

Posted by acmclellen <cm...@gmail.com>.
Hi Saminda,

I had already tried that, and that didn't work either. I'm trying to run an
axis2 client within and axis2 webservice, and for some reason, the timeout
I'm specifying isn't being registered. I resorted to the code below as I had
tried everything else including what you have just proposed I do. I've tried
running the client from a normal web app and that worked as well as within a
junit test, which worked too. So it has to be because it's an axis2
webservice.

Thanks.
Cheers,
Craig




Saminda Abeyruwan-3 wrote:
> 
> Hi,
> 
> All you have to do is, set
> options.setTimeOutInMilliSeconds(1000000);
> 
> in the client code. You don't have to go into internals of HTTPClient.
> Once
> set it like prior, this will automatically configure the httpclien.
> 
> If you need set timeout to be indefinite; then set
> options.setTimeOutInMilliSeconds(-1);  but I wouldn't recommend this.
> 
> Thank you
> 
> Saminda
> 
> On Jan 23, 2008 7:15 PM, acmclellen <cm...@gmail.com> wrote:
> 
>>
>> Hi,
>>
>> My client initialization code is as below, and on submitting a request to
>> the web service, it still times-out after 15 seconds. Please help!!
>>
>> Thank you.
>> Regards,
>> Craig
>>
>> =========begin=========
>> MultiThreadedHttpConnectionManager manager =
>>        new MultiThreadedHttpConnectionManager();
>> HttpConnectionManagerParams params = manager.getParams();
>> params.setSoTimeout(0);
>> params.setConnectionTimeout(0);
>> manager.setParams(params);
>>
>> HttpClientParams p = new HttpClientParams();
>> p.setSoTimeout(0);
>> p.setConnectionManagerTimeout(0);
>>
>> HttpClient httpClient = new HttpClient(p, manager);
>> Options options;
>> options = serviceClient.getOptions();
>> options.setProperty(
>>        HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
>> options.setProperty(
>>        HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
>>
>> options.setTimeOutInMilliSeconds(0);
>> options.setCallTransportCleanup(true);
>>
>> =========end=========
>> --
>> View this message in context:
>> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15041918.html
>> Sent from the Axis - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>
>>
> 
> 
> -- 
> Saminda Abeyruwan
> 
> Senior Software Engineer
> WSO2 Inc. - www.wso2.org
> 
> 

-- 
View this message in context: http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15128266.html
Sent from the Axis - Dev mailing list archive at Nabble.com.


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


Re: axis2 client timeout even with timeouts set to 0

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi,

All you have to do is, set
options.setTimeOutInMilliSeconds(1000000);

in the client code. You don't have to go into internals of HTTPClient. Once
set it like prior, this will automatically configure the httpclien.

If you need set timeout to be indefinite; then set
options.setTimeOutInMilliSeconds(-1);  but I wouldn't recommend this.

Thank you

Saminda

On Jan 23, 2008 7:15 PM, acmclellen <cm...@gmail.com> wrote:

>
> Hi,
>
> My client initialization code is as below, and on submitting a request to
> the web service, it still times-out after 15 seconds. Please help!!
>
> Thank you.
> Regards,
> Craig
>
> =========begin=========
> MultiThreadedHttpConnectionManager manager =
>        new MultiThreadedHttpConnectionManager();
> HttpConnectionManagerParams params = manager.getParams();
> params.setSoTimeout(0);
> params.setConnectionTimeout(0);
> manager.setParams(params);
>
> HttpClientParams p = new HttpClientParams();
> p.setSoTimeout(0);
> p.setConnectionManagerTimeout(0);
>
> HttpClient httpClient = new HttpClient(p, manager);
> Options options;
> options = serviceClient.getOptions();
> options.setProperty(
>        HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
> options.setProperty(
>        HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
>
> options.setTimeOutInMilliSeconds(0);
> options.setCallTransportCleanup(true);
>
> =========end=========
> --
> View this message in context:
> http://www.nabble.com/axis2-client-timeout-even-with-timeouts-set-to-0-tp15041918p15041918.html
> Sent from the Axis - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Saminda Abeyruwan

Senior Software Engineer
WSO2 Inc. - www.wso2.org