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

Reply via email to