aspose file tools*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Web Service Availability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Web Service Availability" Watch "Web Service Availability" New topic
Author

Web Service Availability

Syed Rizvi
Greenhorn

Joined: Sep 14, 2005
Posts: 9
Can anybody suggest me a way of checking a particular web service availability? I'm using AXIS and i need to decide about a particular or alternative course of action in my business logic depending upon the availability of the web service i'm using.

Thanks,

Syed Rizvi,
Senior Consultant,
Deloitte Consulting,
Mumbai - India
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
Why don't you just call it to see if it's there? I guess I must be missing something about your problem.


Ping & DNS - updated with new look and Ping home screen widget
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Ulf:
Is Axis 1.x capable of generating anything like BEA's Generated Asynchronous Web Service Client Stub? I think this would be useful in this kind of situation - apart from a hand coded solution.

Is configuring the org.apache.axis.client.Stub with setTimeout() and catching the resulting java.rmi.RemoteException the simplest thing one can do?
[ November 03, 2005: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Syed Rizvi
Greenhorn

Joined: Sep 14, 2005
Posts: 9
hi Ulf,
The webservice i've to call takes a lot of parameters. Depending upon the availability of the webservice, i've to decide whether to call the webservice or put my processing into batch mode. This is the business logic decision i've to take and for this i need to know whether the webservice is up or not. Please let me know if you are aware of any such method whereby i can check the web service availability ?

Thanks for the help / reply.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
Syed,
I think the best you can do is to telnet into the WS port (e.g. using Commons Net). If it succeeds you'd at least know that the host is reachable and that something is listening on the port.
Since the web service presumably does something complicated (which may rely on other backend systems that could also fail, which the WS would not necessarily know in advance), there is no way to tell whether a call will succeed without actually making one.
[ November 04, 2005: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
Is Axis 1.x capable of generating anything like BEA's Generated Asynchronous Web Service Client Stub?


I'm not aware of anything like this. Might make a good addition to the wsdl2java tool, though, so if you're knowledgeable about asynchonous WS, this could be your chance to give back to the Axis community
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Syed,
I presume that you have no control over the web service that you are using?

The key point is that you do not define what "available" means in your business context. The suggestions Ulf is making let you determine if the host is available - but that will not tell you whether the host is (over)loaded. I suspect that whether the "business service" is "available" isn't a function of the web service technology employed but the fact that you are dealing with a business process that requires an intensive processing effort and the may run over a longer duration - that is a problem that needs to be identified in your business processes so that you can then address it properly with the available web services technology.

An intensive processing effort/long duration web service should have been implemented by using the Asynchronous Business Process Pattern or at least implemented in a "request/reply operation with polling" fashion (see Asynchronous operations and Web services, Part 2, Asynchronous operations and Web services, Part 1: A primer on asynchronous transactions).

Originally posted by Syed Rizvi:
i've to decide whether to call the webservice or put my processing into batch mode.
.

Are the "web service" and "batch mode" completely disparate mechanisms for satisfying the same goal?
Or do they essentially use the same resources to accomplish their goal? If they use the same resources wouldn't it make more sense to remove the burden of this decision from the client and have the webservice put the request on the queue - giving the client a "contact me for the results later" response?
[ November 04, 2005: Message edited by: Peer Reynders ]
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by Ulf Dittmer:
Might make a good addition to the wsdl2java tool, though, so if you're knowledgeable about asynchonous WS, this could be your chance to give back to the Axis community

Don't think I'm quite there yet but its an interesting proposal
I went looking for that functionality because .NET stubs automatically include BeginWebMethod and EndWebMethod methods (Communicating with XML Web Services Asynchronously).
Looks like something is going on because the org.apache.axis.client.async package is already there.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Service Availability
 
Similar Threads
web sites to deploy the web services
Availability of web site or web service
Back-end communication between WS and Java app
Web Service using rmi
do i need Web Service Development Pack ?