aspose file tools*
The moose likes Web Services and the fly likes Error and exception handling in Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Error and exception handling in Web Service" Watch "Error and exception handling in Web Service" New topic
Author

Error and exception handling in Web Service

Raghuveer Rawat
Ranch Hand

Joined: Apr 03, 2003
Posts: 102
hi rancher
Anyone who has handled exception and error in web service. Soap Spec says error and exception will be carried in fault element in which it has actor, action, details etc.
But I am in doubt when calling some web service method suppose method throws SQLException what happens in this case soap toolkit automatically generates corresponding fault code. or we have to some additional work for it.
How to process error at client side in case of error or exception.


Raghuveer Rawat<br />SCJP2
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
See this example from Apache axis.. its show how to throw an soap fault when there is no such employee reqeust.. you can try to use the same logic for your case.
Kuldeep Vaishnav
Ranch Hand

Joined: May 23, 2004
Posts: 72
Hi,
Sorry about jumping on the wagon but I was looking at the example pointed out by Balaji and it seems Mr.Dims has tried to fix the "Bug 19682 - non-AxisFault exceptions don't have details serialized"...But the example fault(NoSuchEmployeeFault)does not contain detail section....can someone please point me to an example containing a user defined fault with details section? I had serious problems trying to implement(which ultimately I could not)a fault with detail section few weeks back.....


Kuldeep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error and exception handling in Web Service
 
Similar Threads
SOAP - Apache
SOAPFault
Testing Web Services
Can a one-way SOAP message send a fault?
axis2: set SC_BAD_REQUEST with AxisFault