2 Replies Latest reply on Jan 9, 2013 9:48 AM by kanci

    SOAP fault handling

    kanci Newbie

      Hi all,

       

      I'm trying to setup a small use case with switchyard and camel. It works well when it comes to happy flow. But actually from time to time I get a reasonable fault, which get logged, but somewhat lost.

       

      So I used the "camel-soap-proxy" quickstart to see if I did something wrong, but actually it happens to behave the same way.

      I added single line to ReverseService to produce conditional fault:

       

      if ("fail".equals(text)) throw new IllegalArgumentException();

       

      Then I use the soap-request.xml with soap ui and get correct response for ReverseService and the proxified service.

       

      After that I replaced "foobar" with "fail" and got the difference - the service itself delivers a fault:

       

      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

         <soap:Body>

            <soap:Fault>

               <faultcode>soap:Server</faultcode>

               <faultstring>Fault occurred while processing.</faultstring>

            </soap:Fault>

         </soap:Body>

      </soap:Envelope>

       

      but the proxified version delivers the original request:

       

      <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">

         <SOAP-ENV:Header/>

         <SOAP-ENV:Body>

            <ns2:reverse xmlns:ns2="urn:switchyard-quickstart:camel-soap-proxy:1.0">

               <text>fail</text>

            </ns2:reverse>

         </SOAP-ENV:Body>

      </SOAP-ENV:Envelope>

       

      I used "switchyard-as7-0.7.0.Final.zip" for the above test. Using MessageTrace handler I see, that the Fault is processed, but I have no idea by whom and what can I do to process it myself, preferably in camel xml.

       

      Is there another example that handles faults? I couldn't found anything appropriated.