• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Setting timeout for JAVA program connecting to web service.

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Marshal
Posts: 22448
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Third party library => move to Other APIs
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 22448
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
We must storm this mad man's lab and destroy his villanous bomb! Are you with me tiny ad?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic