-
Jan 28th, 2013, 05:00 PM
#1
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules