-
1. Re: Throwing SoapFaults (no details)
niwhsa Oct 7, 2005 1:39 AM (in response to thewulf)Create a custom checked exception (sub class of java.lang.Exception) with all the properties you want. Throw this exception from your SEI methods. Wscompile should be able to handle this easily. I have done this and works great (even parent class properties get listed in the soap-fault tag is wsdl).
Unless I misunderstood your question, the above should do the trick
Example: In our code, we throw ExceptionA which extends project generic exception ExceptionB whihc in turn extends the java.lang.Exception.
This is what is available in the wsdl file<complexType name="ExceptionA"> <complexContent> <extension base="tns:ExceptionB"> <sequence/></extension></complexContent></complexType> <complexType name="ExceptionB"> <sequence> <element name="causeID" type="int"/> <element name="extendedMessage" type="string" nillable="true"/> <element name="logID" type="int"/> <element name="message" type="string" nillable="true"/></sequence> </complexType>
As you can see casueID, extendedMessage, logID and message are properties of Exception B. -
2. Re: Throwing SoapFaults (no details)
thewulf Oct 7, 2005 11:14 AM (in response to thewulf)Thanks for the tips! The real problem was I was declaring "throws Throwable" instead of "throws MyException". I realized that when you said wscompile should have picked it up... it couldn't have picked it up if it wasn't declared.
Thanks again.