Spring WS Adding Detail to SoapFault Exception Handling

You may also like...

  • BalRanj

    Fantastic. Just worked by referring the above steps. Thanks for your efforts.

  • Anton

    Thanks!

    BTW, you can use detail.getResult to marshal fault info into detail element. For example, if you have FaultInfo class generated by JAXB from WSDL, you can use:

    if (nonNull(faultInfo)) {
    SoapFaultDetail detail = fault.addFaultDetail();
    Result result = detail.getResult();
    try {
    JAXB_CTX.createMarshaller().marshal(faultInfo, result);
    } catch (JAXBException e) {
    LOGGER.error(“Error serializing [{}] fault info”, ex.getClass().getSimpleName(), e);
    }
    }