Timeout on client side when calling web service method

A

Ale

Hello,

I've a client calling a web service method (using JAX-WS), which
randomically doesn't receive any answer or error, or exception, so
that client waits forever without dying.

I can't touch the web service code, but I can add a client timeout;
the issue is that using these props

System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
System.setProperty("sun.net.client.defaultReadTimeout", "300000");

it doesn't work because they only deal with network connection (which
of course doesn't disconnect)

Any suggestion ?

Thanks a lot,
Ale
 
L

Lew

Ale said:
I've a client calling a web service method (using JAX-WS), which
randomically doesn't receive any answer or error, or exception, so
that client waits forever without dying.

I can't touch the web service code, but I can add a client timeout;
the issue is that using these props

System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
System.setProperty("sun.net.client.defaultReadTimeout", "300000");

it doesn't work because they only deal with network connection (which
of course doesn't disconnect)

Any suggestion ?

http://www.lmgtfy.com/?q=Java+web+service+client+timeout
 
L

Lew

It was definitely not hard.

But was it useful??

I am not clear what the antecedent for "it" is in that sentence. Do you mean
the links that result from that search? I pursued several and they do bear on
the OP's question, many of them. You don't think I'd post a link without
verifying its usefulness, do you?????????????????????????????????????????????
 
A

Arne Vajhøj

I am not clear what the antecedent for "it" is in that sentence. Do you
mean the links that result from that search?
Yes.

I pursued several and they
do bear on the OP's question, many of them.

I tried the first 10 links and as far as I can tell they do not
provide a solution for the question asked.

What link do you think provide a solution?

Arne
 
L

Lew

I tried the first 10 links and as far as I can tell they do not
provide a solution for the question asked.

What link do you think provide a solution?

Ahem. I didn't say "provide a solution", I said "bear on the ... question".

http://objectmix.com/weblogic/573926-setting-timeout-web-service-client.html
was one that discussed timing out without mentioning that it was a connection
timeout but a read timeout. Without doing the deeper research I trust the OP
will have done by now, I cannot say how much that information translates to
the OP's question:
I've a client calling a web service method (using JAX-WS), which
randomically doesn't receive any answer or error, or exception, so
that client waits forever without dying.

I can't touch the web service code, but I can add a client timeout;
the issue is that using these props

System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
System.setProperty("sun.net.client.defaultReadTimeout", "300000");

it doesn't work because they only deal with network connection (which
of course doesn't disconnect)

Naturally I wouldn't expect the actual literal character-for-character
solution to copy-and-paste into the OP's scenario, but that link and others
like it from the suggested search seem like reasonable jumping-off points to
me. It's certainly how I'd go about researching this question were I facing
it in my own work.

How would you do it?
 
A

Arne Vajhøj

Ahem. I didn't say "provide a solution", I said "bear on the ... question".

> was one that discussed timing out without mentioning that it was a
> connection timeout but a read timeout. Without doing the deeper research
> I trust the OP will have done by now, I cannot say how much that
> information translates to the OP's question:

That uses a WebLogic specific method to set a timeout in JAX-RPC,
which is different from the JAX-WS API that the question is about.
Naturally I wouldn't expect the actual literal character-for-character
solution to copy-and-paste into the OP's scenario,

Neither would I.

But maybe something that at least used the same framework as
the OP!
but that link and
others like it from the suggested search seem like reasonable
jumping-off points to me. It's certainly how I'd go about researching
this question were I facing it in my own work.

How would you do it?

Google a lot.

Maybe ask in a forum for help.

Be extremely irritated over LMGTFY replies that does
not lead to a solution.

Arne
 
M

Mike Schilling

Ale said:
Hello,

I've a client calling a web service method (using JAX-WS), which
randomically doesn't receive any answer or error, or exception, so
that client waits forever without dying.

I can't touch the web service code, but I can add a client timeout;
the issue is that using these props

System.setProperty("sun.net.client.defaultConnectTimeout", "300000");
System.setProperty("sun.net.client.defaultReadTimeout", "300000");

it doesn't work because they only deal with network connection (which
of course doesn't disconnect)

The second of these sets a read timeout, which is exactly what you want: to
time out when the client is trying to read the response from the server.
However, it's a timeout for a specific client implementation. According to
http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.html, it's
" for the protocol handler used by java.net.URLConnection." It also says
"These properties may not be supported in future releases.", and that is a
1.4.2-specific page. (I can't find a newer page describing this property.)
What you need to find out is how to set a read timeout for the network
library that your client is using.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top