Announcement Announcement Module
Collapse
No announcement yet.
Exception handling outside a ws-gateway Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exception handling outside a ws-gateway

    Hi,

    I have a ws inbound-gateway that receives a message, places it on a message channel.

    <int-ws:inbound-gateway id="wsModifyKeys"
    request-channel="modifyKeysInputChannel" reply-channel="modifyKeysOutputChannel"
    marshaller="xmlBeansMarshaller" unmarshaller="xmlBeansMarshaller" />


    That message is picked up by a service activator and handed to a pojo for processing. When the pojo is finished processing it places the response on the "modifyKeysOutputChannel" channel which send the reply back to the caller.

    My question is how to send a proper SOAPFault back when the processing fails. Currently I am doing the following in the pojo:



    SOAPFault soapFault = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PRO TOCOL).createFault();
    soapFault.setFaultString("Internal server runtime exception");
    QName name = new QName("SOAP-ENV:Fault");
    soapFault.addDetail().addDetailEntry(name);
    Message<SOAPFaultException> errorMessage = null;
    SOAPFaultException sfe = new SOAPFaultException(soapFault);
    errorMessage = MessageBuilder.withPayload(sfe).build();

    return errorMessage;

    This does get a SOAPFault back to the caller but the "detail" tag is missing.

    So I have 2 questions:

    1. Am I taking the correct approach?
    2. Why does the "Detail" tag get stripped from the SOAPFault returned back to the caller?


    Thanks,

    Frank
Working...
X