tag:blogger.com,1999:blog-4959735800177828180.post5202522431318673936..comments2022-03-02T00:24:40.435+01:00Comments on Un "POU"co De ...: ...customize SOAP Fault in SwitchYardUnknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4959735800177828180.post-84443203178610088022014-11-19T15:22:51.490+01:002014-11-19T15:22:51.490+01:00Hi Jorge, I come from SwitchYard forum. https://de...Hi Jorge, I come from SwitchYard forum. https://developer.jboss.org/thread/249761<br /><br />I'm trying to figure out how to do exception handling with RESTEasy binding. At the very first time, I thought Message Composer is a silver bullet for this but I think I was wrong. The decompose() method invocation take places before JAXB bind the response message content to XML. <br /><br />Additionally, the REST method's return type is immutable during the exchange, so even if I change the content type of the response message to a "Error DTO", then a class cast exception will occur. <br /><br />My REST interface's method:<br />/*<br /> some JAX-RS annotations<br />*/<br />public BookList getBooks()<br /><br />My decompose method's code fragment:<br />if (exchange.getState().equals(ExchangeState.FAULT)) {<br /><br />exchange.getMessage().setContent(new BaseDTO("345", "Something wrong inside..."));<br /><br />}<br /><br />Could you give me some idea for this?<br />ThanksAnonymoushttps://www.blogger.com/profile/07554579050828041078noreply@blogger.com