Yes sure, I've changed the original names. When cxf:bean:myServiceEndpoint is
called for some conditions, it returns soap:fault message. I handle this
with checking whether the message contains faultstring or not. It's not a
good solution for me. How can i find out whether it has soap:fault or not
with camel? Is there a better way of doing this?
Also if there is a fault message, how can i marshall it to an object?

                <camel:route id="myRoute" startupOrder="9">
                        <camel:from uri="direct:route1" />
                        <camel:doTry>
                                <camel:to uri="direct:route2" />
                                <camel:choice>
                                        <camel:when>
                                                <camel:simple 
resultType="java.lang.String">${property.destination} 
== 'X'</camel:simple>
                                                <camel:unmarshal>
                                                        <camel:soapjaxb 
contextPath="com.test.a.b"
elementNameStrategyRef="objectTypeStrategy" />
                                                </camel:unmarshal>
                                                <camel:bean 
ref="reservationProcessor" method="createReservation" />
                                                <camel:bean 
ref="reservationProcessor" method="savePreRezervasyon" />
                                                <camel:marshal>
                                                        <camel:soapjaxb 
contextPath="com.test.a.b"
elementNameStrategyRef="objectTypeStrategy" />
                                                </camel:marshal>
                                        </camel:when>
                                        <camel:when>
                                                <camel:simple 
resultType="java.lang.String">${property.destination} 
== 'Y'</camel:simple>
                                                <camel:to 
uri="cxf:bean:myServiceEndpoint" />
                                                <camel:convertBodyTo 
type="java.lang.String" />
                                                <camel:choice>
                                                        <camel:when>
                                                                
<camel:simple>${in.body} contains 'faultcode' or ${in.body} contains
'faultstring'</camel:simple>
                                                        </camel:when>
                                                        <camel:otherwise>
                                                                
<camel:unmarshal>
                                                                        
<camel:soapjaxb contextPath="com.test.a.b"
elementNameStrategyRef="objectTypeStrategy" />
                                                                
</camel:unmarshal>
                                                                <camel:bean 
ref="reservationProcessor" method="savePreRezervasyon"
/>
                                                                <camel:marshal>
                                                                        
<camel:soapjaxb contextPath="com.test.a.b"
elementNameStrategyRef="objectTypeStrategy" />
                                                                </camel:marshal>
                                                        </camel:otherwise>
                                                </camel:choice>
                                        </camel:when>
                                </camel:choice>
                                <camel:doCatch>
                                        
<camel:exception>java.lang.Exception</camel:exception>
                                        <camel:to uri="direct:handleException" 
/>
                                </camel:doCatch>
                        </camel:doTry>
                        <camel:convertBodyTo type="java.lang.String" />
                </camel:route>



--
View this message in context: 
http://camel.465427.n5.nabble.com/Soap-Fault-Unmarshal-tp5744949p5744983.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to