Luke Pillow wrote:
I'm just starting to work with XFire's Fault/Exception handling and
I'm afraid that I may be misunderstanding how to leverage it. How can
I create a custom exception that doesn't inherit from XFireException
or XFireFault, but will allow custom <faultcode>, <faultstring>, and
<faultactor> values to be populated upon Exception to Fault
conversion/serialization? I thought I could do this if I create d my
own FaultHandler, but it doesn't appear that I have access to the
original exception on the fault pipeline.
Thanks for your help in advance!
Luke Pillow
Hi Luke,
Sorry this isn't in the docs - but you can pull it out of the message
context. See how this class does it if you want to write your own fault
handler:
http://svn.xfire.codehaus.org/viewrep/xfire/trunk/xfire/xfire-core/src/main/org/codehaus/xfire/handler/DefaultFaultHandler.java?r=1536
However it may be easier to just write a Handler for the fault pipeline.
Then you can access the XFireFault like so:
public void invoke(MessageContext context) {
XFireFault fault = (XFireFault) context.getCurrentMessage().getBody();
... do something
}
and then add it to the service:
service.addFaultHandler(new MyFaultHandler());
Hope that helps. Cheers,
- Dan
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog