Thanks again, Dan!
Besides this part I really like JAXWS (and CXF). Simple, it works, and it is
very fast to implement something. On top of that, the generated WSDL looks
pretty clean too.
Guy
On 11-okt-2011, at 19:50, Daniel Kulp wrote:
On Friday, October 07, 2011 12:40:23 PM Guy Pardon wrote:
> Hi,
>
> I found a lot of references to this but no clear explanation or solution:
>
> A simple application exception seems mapped to WSDL faults without problems.
> But if I want my jaxws service to throw exceptions of some subclass
> hierarchy, then the WSDL does not reflect that hierarchy in the fault types
> (and the generate client code does not either). They will appear as
> unrelated faults, so the client code cannot use the exception hierarchy for
> dealing with errors in the catch blocks.
>
> Example, if I want the following then what is the right way of doing this in
> JAXWS? And: where is this specified in the specs or docs?
It doesn't look like JAX-WS handles this at all. Exceptions are created from
the Message, not the types of the parts in the message. Since messages don't
have any sort of hierarchy, there isn't a way to create a hierarchy.
:-(
Dan
>
> SERVER:
>
> @WebService
> public class MyService {
>
> public void doIt() throws MyException {
> throw new MySubException();
> }
>
> }
>
> public class MyException extends Exception {
>
> }
>
> public class MySubException extends MyException {
>
> }
>
> CLIENT:
>
> try {
> service.doIt();
> } catch (MySubException specificError) {
> //...
> } catch (MyException generalError) {
> //...
> }
>
> Thanks
> Guy
--
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com
Dr. Guy Pardon | Atomikos BVBA | a 'Cool Vendor' by Gartner in 2011
CTO
Phone: +32 15 61 30 55 | Email: [email protected] | Twitter:
http://twitter.com/guypardon | Skype: guypardon | YahooIM: guypardon
Europe: CET (local time: http://www.timeanddate.com/worldclock/city.html?n=48)
Visit us at http://www.atomikos.com/
Visit our blog at http://blog.atomikos.com/
Visit the Atomikos TransactionsEssentials Community at
http://fogbugz.atomikos.com/default.asp?community
Visit the Atomikos Training site at
http://www.atomikos.com/Main/AtomikosTraining
The information in this email is confidential and only meant for the
addressee(s). The content of this email is informal and will not be legally
binding for Atomikos.