camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Raible <m...@raibledesigns.com>
Subject Convert from Fault to Message
Date Fri, 25 Jul 2014 22:07:26 GMT
Hello,

Is it possible to convert from returning a SOAP Fault to a SOAP Message when using the CXF
component? I'm developing a new system to replace one written with IBM Message Broker 6.1.
When faults occur with IBM, error messages are returned that looked the following:

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
	<soapenv:Body>
		<NS1:memberServiceRequest xmlns:NS1="http://ws.app.company.com">
			<NS1:return>
				<NS1:errorData>
					<Error>Error goes here</Error>
				</NS1:errorData>
			</NS1:return>
		</NS1:memberServiceRequest>
	</soapenv:Body>
</soapenv:Envelope>

When an error occurs with Apache Camel, a soap fault is sent back to the client:

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
	<soap:Body>
		<soap:Fault>
			<soap:Code>
				<soap:Value>soap:Receiver</soap:Value>
			</soap:Code>
			<soap:Reason>
				<soap:Text xml:lang="en">Error goes here</soap:Text>
			</soap:Reason>
		</soap:Fault>
	</soap:Body>
</soap:Envelope>

I believe sending back a fault is better, but I'd also like to make it possible to be backwards
compatible, so the old clients don't need to add fault handling. To do this, I need to convert
from a fault to a message.

The following Stack Overflow post seems like it might work, but I'm unsure how to add an out
interceptor when the only way I'm definining my CXF service is with "cxf:/foo?serviceClass=...".

http://stackoverflow.com/questions/8066474/how-to-transform-soapfault-to-soapmessage-via-interceptor-in-cxf

Thanks,

Matt
Mime
View raw message