Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

setting webservice timeout  RSS feed

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I just started on a project which uses websphere 5.
I am invoking a webservice and want to set timeout on my client
code so it does not
wait very long in case the server is not responding.
I am using send() and receive() on org.apache.soap.messaging.Message object. I do not see anywhere in the API a timeout setting method.
Please suggest to solve this problem.
Thanks
Roshan
 
Roshan Lal
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The problem is solved. All I needed to do was override the default connection used by message's send method.
eg.
Message msg = new Message;

msg.setTransport(new SOAPHTTPConnection().setTimeout(someNumber));

msg.send(url,"", soapenvelope);
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!