Hi Jay,

the use case in the article is special as he wants to tweak an exception thrown 
by the framework. If you only want to throw an exception that is part of your
contract then this article may help you:

http://liquid-reality.de/display/liquid/2008/08/20/Defining+Contract+first+webservices+by+generating+wsdl+from+java

The article is more about generating WSDLs from java and later use them to 
generate code but it also shows how exceptions with details are handled so it 
may help you.

You can also take a look at the wsdl first example in CXF. It contains an 
exception with fault details:

You use it in this way in the server:
http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java

and in the client:
http://svn.apache.org/repos/asf/cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java

In general the trick is that a suitable wsdl will geenerate the right java 
exception classes that help you transport the details.

Christian


-----Ursprüngliche Nachricht-----
Von: jaybytez [mailto:[email protected]] 
Gesendet: Freitag, 18. Februar 2011 01:33
An: [email protected]
Betreff: Exchange of Custom Exception Between Client/Server


I have an exception that carries an internal collection of error objects for 
exchanging validation errors we are exchanging between the client and the 
service endpoint.

I have read about the WebFault and CXF's usage of Interceptors.

I was able to use this article about Interceptors to add more detail in the 
SoapFault to carry the validation information in the SoapFault to the client.

http://i-proving.ca/space/Technologies/Apache+CXF/Adding+an+interceptor+to+the+CXF+fault+chain

The thing is I don't know how to pull that information out of the SoapFault on 
the client side.

Is there a better way to do this if I want to throw an Exception from the 
service endpoint that gets serialized over the wire and then on the client side 
gets converted from the fault back into the original Exception.

Thanks for the help and pointers,

jay
--
View this message in context: 
http://cxf.547215.n5.nabble.com/Exchange-of-Custom-Exception-Between-Client-Server-tp3390380p3390380.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to