views:

97

answers:

1

Hey guys,

I'm dealing with an auto-generated WebService stub in Java (generated using JAX-WS RI).

My actual service is a .Net program exposing its webservice using the WCF basicHttpBinding.

How should I be dealing with Communiction problems during the actual WebService call. (i.e. the way in WCF on the client you would wrap your call with a catch CommunicationException if communication/network problems were encountered).

It seems like there are no checked exceptions for dealing with this.

(When I view the auto-generated stub interface by web service methods don't throw an Exceptions, other then the predefined FaultExceptions/Messages exposed by WSDL).

Also, when I actually tested what would happen during a WebService call if the network was disconnected, the client simply hung on the call, instead of throwing even some sort of runtime exception.

Thoughts?

Thanks

A: 

Why would you think it useful to have to deal with a communication error (e.g. due to a network failure) as a checked exception? How could the caller of a webservice usefully deal with such an eventuality?

It seems better to me to allow an unchecked exception to propagate up the stack until a point where it can reasonably be handled.

oxbow_lakes
It could be a runtime exception as well, however in my case it seems like no exception is being thrown and the service call simply hangs. In a corresponding .Net WCG Client application, I can catch CommunicationExceptions and TimeOutExceptions and deal with the accordingly.
vicjugador