Issue Type: Bug Bug
Affects Versions: 0.6
Assignee: Unassigned
Created: 06/Sep/12 9:49 AM
Description:

Have three switchyard apps (java bean + SOAP bindings) generated for Savara (attached).

When sending a normal initial request, the flow completes without any issues. However if a message is sent that triggers the CreditAgency service to return a SOAP fault, this results in a transformation failure in the Store service.

16:13:09,373 ERROR [org.apache.camel.processor.DefaultErrorHandler] (http--127.0.0.1-8080-1) Failed delivery for (MessageId: ID-gbrown-redhat-36564-1346685168619-4-3 on ExchangeId: ID-gbrown-redhat-36564-1346685168619-4-4). Exhausted after delivery attempt: 1 caught: org.switchyard.exception.SwitchYardException: Failed to unmarshall for 'java:org.jboss.examples.creditagency.CreditRatingType'.: org.switchyard.exception.SwitchYardException: Failed to unmarshall for 'java:org.jboss.examples.creditagency.CreditRatingType'.
at org.switchyard.transform.jaxb.internal.JAXBUnmarshalTransformer.transform(JAXBUnmarshalTransformer.java:87) [switchyard-transform-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at org.switchyard.transform.jaxb.internal.JAXBUnmarshalTransformer.transform(JAXBUnmarshalTransformer.java:43) [switchyard-transform-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at org.switchyard.transform.TransformSequence.apply(TransformSequence.java:119) [switchyard-api-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at org.switchyard.transform.TransformSequence.applySequence(TransformSequence.java:211) [switchyard-api-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at org.switchyard.handlers.TransformHandler.handleMessage(TransformHandler.java:83) [switchyard-runtime-0.6.0-SNAPSHOT.jar:0.6.0-SNAPSHOT]
at org.switchyard.bus.camel.HandlerProcessor.process(CamelExchangeBus.java:217)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) [camel-core-2.10.0.jar:2.10.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73) [camel-core-2.10.0.jar:2.10.0]

From examining the Message Trace, it shows the SOAP Fault envelope on the bus, but also the contentType is listed as the normal operation response, instead of the type associated with the fault:

------- Begin Message Trace -------
Service -> {http://www.savara.org/Purchasing/Store}CreditAgency
Operation -> creditCheck
Phase -> OUT
State -> OK
Exchange Context ->
org.switchyard.exchangeDurationMS : 164
Message Context ->
org.switchyard.relatesTo : 9185e8cd-2ae5-49a9-9963-d15e1d79447f
org.switchyard.transform.TransformSequence : org.switchyard.transform.TransformSequence@2d0d345a
org.switchyard.messageId : 4d9f5e11-94a0-4e83-b5fe-1a42ec16a2ca
org.switchyard.contentType : {http://www.jboss.org/examples/creditAgency}CreditRating
Message Content ->
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Fault xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><faultcode xmlns:ns0="http://www.w3.org/2003/05/soap-envelope">ns0:Fault</faultcode><faultstring>Send failed</faultstring><detail><CustomerUnknown xmlns="http://www.jboss.org/examples/creditAgency" id="1"/></detail></SOAP-ENV:Fault>
------ End Message Trace -------

The normal path works fine, when sending the following message to: http://localhost:8080/StoreService/StoreService

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stor="http://www.jboss.org/examples/store">
<soapenv:Header/>
<soapenv:Body>
<stor:BuyRequest id="1" product="12345" customer="Joe"/>
</soapenv:Body>
</soapenv:Envelope>

But when sending a message that causes a fault path to be taken,

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stor="http://www.jboss.org/examples/store">
<soapenv:Header/>
<soapenv:Body>
<stor:BuyRequest id="1" product="12345" customer="Fred"/>
</soapenv:Body>
</soapenv:Envelope>

you will see the error outlined above.

The fault envelope needs to be removed, so that existing XML to Java transformers can be leveraged - and also the contentType needs to reflect the fault type.

Project: SwitchYard
Priority: Major Major
Reporter: Gary Brown
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira