aspose file tools*
The moose likes Web Services and the fly likes Can we raise SOAP Fault for Application errors?    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Can we raise SOAP Fault for Application errors?    " Watch "Can we raise SOAP Fault for Application errors?    " New topic
Author

Can we raise SOAP Fault for Application errors?

satish jupalli
Greenhorn

Joined: Apr 06, 2003
Posts: 10
I would like to know whether it is good idea to raise a SOAP fault for Application or system level exceptions. For example, I'm searching for a user with an ID as request , If the ID is invalid(User is not found) is it OK to raise the SOAP Fault.
Let me know your views regarding the same.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi Satish,
Please read the section 4.6.5 of the article Using SOAP with J2EE, it might help you to decide further.
Regards
Balaji


Spritle Software Blogs
satish jupalli
Greenhorn

Joined: Apr 06, 2003
Posts: 10
Thanks Balaji
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Originally posted by satish jupalli:
I would like to know whether it is good idea to raise a SOAP fault for Application or system level exceptions.


Ideally you would declare your application level faults as SOAP faults in the WSDL. Your WSDL-to-Java code generator should then generate the necessary application exception classes when it generates the service skeleton.

Note however that it is totally up to the client (and its web service framework) to map the resulting SOAP faults to any equivalent exceptions - so the Java exception that you throw will not necessarily be the same that the client sees - it just gets the resulting SOAP fault.

This topic may be of some interest.


"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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we raise SOAP Fault for Application errors?
 
Similar Threads
Error
Message context in webservice
Getting Error When uploading Via SOAP API in Ruby
A BP question(R1030): what is end user in w
Axis fault