This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes Basic SOAP fault question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Basic SOAP fault question" Watch "Basic SOAP fault question" New topic
Author

Basic SOAP fault question

Marc LaFleur
Greenhorn

Joined: Nov 03, 2009
Posts: 2
My web service will be returning a generic SOAP fault (soap:Fault) when there is an XML validation error.

Do I need to define this fault in the WSDL for my service?

Or is it just understood that a generic SOAP fault could be a response to a SOAP web service request?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
The WS-I Basic Profile does not mandate (using SHOULD, not MUST) that all faults are declared:
http://www.ws-i.org/Profiles/BasicProfile-1.1.html#Enumeration_of_Faults

Warning: Here follows unsolicited advice on faults:
However, since you already know under what circumstances you want to return a fault, returning a custom fault, which also is declared in the WSDL, would be a courtesy to clients having only a WSDL to refer to. I would want to compare it to throwing a Throwable exception when a method receives an illegal parameter, when a IllegalArgumentException would be more informative to clients.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic SOAP fault question
 
Similar Threads
Exception handling!
Null Pointer exception during run client code using Axis 1.4 on weblogic 8.1
SOAPFault
unable to invoke a method on my SOAP service
doubt in web service security