You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Wong <up...@yahoo.com> on 2008/09/27 03:19:58 UTC

How can I get a Fault Response in JSON format?

Is there a way to get Fault messages in JSON?  Right now, I have a service that tries to consume (and produce) a JSON message.  However if there is an UnmarshalException while tryng to bind the incoming message, an XML fault code message is returned (<ns1:XMLFault...).  This can be bad if the caller was expecting JSON.  

A more general question would be how can I customize return messages even if an error happens upstream of my actual service?  

Thanks!
-Robert  



      

RE: How can I get a Fault Response in JSON format?

Posted by Sergey Beryozkin <se...@iona.com>.
Are you using JAX-RS ?

Cheers, Sergey

-----Original Message-----
From: Wong [mailto:upc13@yahoo.com] 
Sent: 27 September 2008 02:20
To: users@cxf.apache.org
Subject: How can I get a Fault Response in JSON format?

Is there a way to get Fault messages in JSON?  Right now, I have a service
that tries to consume (and produce) a JSON message.  However if there is an
UnmarshalException while tryng to bind the incoming message, an XML fault
code message is returned (<ns1:XMLFault...).  This can be bad if the caller
was expecting JSON.  

A more general question would be how can I customize return messages even if
an error happens upstream of my actual service?  

Thanks!
-Robert  



      

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland