• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic WebService Question

 
Kris Battula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose i have a webservice deployed in a server, and using JAX-RPC i am trying to invoke the service, my question is what happens is the server is down? if the server is down do i have to code the client in such a way that it should resend the request? please answer?
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are building your own client, then it would probably be good to have a configurable amount of time to wait for a reply, in case the server is busy, and a configurable number of times the client should retry the operation, before failing.

This will depend on the user experience you want to build and the nature of what is being sent over the web service.

If there is a visual screen where a user would be watching a "please wait" message while the service is invoked, it may be better to only try once (withing a configurable timeout), and if that attempt fails, then display a message indicating the connection could not be established because the server appears to be down, and present them with a "retry" button.

If the web service is invoked by a system process, such as a scheduled task, or one that does not have a user interface with it, then automatic retry a couple of times when the server is down may be a good thing, and if after the configured number of retries, log an error message and give up.
 
Kris Battula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anyone please provide a prototype how this can be done using Jax-Rpc client API? first of all is it possible?
 
Kris Battula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can any body please proivde me a prototype how can i do this using JAX-RPC client API..
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think JAX-RPC lets you set a timeout, so either you need to implement a generic solution (possibly involving a separate thread), or you could use the timeout mechanism of the underlying transport library (which would tie you to that library).

Once you have that, implementing a mechanism to retry several times should be simple.
[ June 07, 2006: Message edited by: Ulf Dittmer ]
 
Kris Battula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ulf,
Could you be more specific, how do i handle this!!
Thanks Bunch!!
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking how you can run a Java thread for a fixed time and then interrupt it, how to set the timout, or how to run the request several times if necessary?

If you're using Axis, you can set the timout either using the WSDL2Java stubs, if that's the type of client you use, or using the Axis MessageContext as described here.
[ June 07, 2006: Message edited by: Ulf Dittmer ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic