• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting timeout for JAVA program connecting to web service.  RSS feed

 
Susan Smith
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a JAVA program that connects to a web service to get data regularly.
But I notice that the program sometime hung when connecting to the data source. Is there any way I can set the timeout value?



Thanks in advance for all the help.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16009
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classes that you use in the com.webservices package are not standard Java classes; they come from a third-party library (maybe a library written by someone else in your company?). You'll have to lookup the documentation of the library that you're using to find out if there is any way to set a timeout.

Note, it's Java, not JAVA. It's not an acronym.
 
Vilmantas Baranauskas
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This depends on client library you use. On Axis1 you may invoke stub.setTimeout(30*1000) on org.apache.axis.client.Stub.

This will set 30sec timeout for web service access.

Unfortunately, we had some very rare and strange cases when connection still "hangs" and 30sec timeout doesn't work.
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Third party library => move to Other APIs
 
Kasi Viswan
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vilmantas,

Do we have any such timeout setting options when we use JWSDP, please advice.

Thanks
Kasi
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please Don't Wake The Zombies. The last post in this thread was 9 months old, and Vilmantas hasn't been active for quite some time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!