File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we raise SOAP Fault for Application errors?

 
satish jupalli
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
satish jupalli
Greenhorn
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Balaji
 
Peer Reynders
Bartender
Posts: 2934
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic