Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting time out for web service call

 
rishimi mishiri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our application, I am using webservice client generated from a wsdl provided by other web service application vendor. Sometimes calls to the webservice keeps on waiting for connection, may be due to network problem or webservice is down. Can anybody tell me how to set time out value so that it can close the connection if it could not get in certain time. Is this possible at the client side code or do we need modify wsdl in order to set this or is there any other way to achieve this?
 
Chethan Verma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Is your client a JAX-RPC or JAX-WS client?

You can set timeout on JAX-RPC clients using setTimeout(int timeout) method on the Stub.

For JAX-WS clients also you can set timeout using BindingProvider, but for some reason it is not working with Websphere 6.1
 
shaz washere
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm seeing a similar problem in my application.

I'm using JAX-RPC with websphere v6.1. I've tried too many configurations and code snippets to set the TimeOut value.

1) (Stub) myStub.setTimeOut(20*000)
2)Configuring the ibm-webservicesclinet-bnd.xmi deployment descriptor

But nothing seems to work.
With the timeout set to 20 seconds,when the webservice provider is unavailable, application takes over 5 mins to come back with a General Exception, but since our Total transaction TimeOut (in the WAS console) is only 120 secs, the applications sees a Timeout exception and Rollback is performed. The Network team analyzed the issue and said our Client is creating multiple request to the provider which could be the reason why it takes more than the TimeOut value to return.

I did come across this article by IBM and feel it could be my issue although i'm not using SSL as IBM reports:
http://www-01.ibm.com/support/docview.wss?uid=swg1PM24564

IBM doesnt mention any temporary fixes for this, can anybody help me limit the number of attempts ot the total time of all attempts ?? so that my app works fine.

Regards,
shaz
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic