Thank you Willem. I'll try out.
Regards Raman -----Original Message----- From: Willem Jiang [mailto:[email protected]] Sent: Tuesday, December 13, 2011 2:49 PM To: [email protected] Subject: Re: creating SoapFault with custom exceptions Hi, You can find some information about it here[1] [1]http://willemjiang.blogspot.com/2011/01/how-to-map-soap-fault-message-with.html On 12/12/11 7:59 PM, Malisetti, Ramanjaneyulu wrote: > Hi > we have the following code to create SoapFault for sending server side > exception to client. On client side, detail part coming as Null. I see some > posts in CXF forum on this issue and addressed as issue has been solved. We > are using CXF 2.3.0 > > > SOAPMessage response = msgFactory.createMessage(); > CustomException cusEx = (CustomException) ((ex instanceof > CustomException) ? ex > : new CustomException (ex)); > try { > response.getSOAPBody().addNamespaceDeclaration("ns1", > "http://com.test.ns1"); > response.getSOAPBody().addNamespaceDeclaration("ns2", > "http://com.test.ns2"); > > WSAddressingUtil.addHeader(response, > WSAddressingUtil.ACTION, > WSTransferUtil.TRA_FAULT); > SOAPFault fault = response.getSOAPBody().addFault(); > fault.setFaultActor("ns2:Sender"); > fault.setFaultCode("ns1:UnsupportedData"); > fault.setFaultString("The data specified on the request > message is not supported " > + "by the endpoint."); > fault.addDetail().addTextNode(Util.getStackTrace(cusEx)); > } catch (Exception e) { > e.printStackTrace() > } > > IS there anything wrong with this code? > > > Thanks > > Regards > Raman > -- Willem ---------------------------------- FuseSource Web: http://www.fusesource.com Blog: http://willemjiang.blogspot.com (English) http://jnn.javaeye.com (Chinese) Twitter: willemjiang Weibo: willemjiang
