You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by L F <l8...@yahoo.com.INVALID> on 2015/02/20 10:04:16 UTC

Generating SoapFault from Spring DSL

Hi
I'm trying to implement a webservice operation as a camel route (spring DSL), and I'd  like to generate a soap fault from the route, when some condition is met. I created a route which should prepare this soap fault :
<route id="SendErrorResponse">
            <from uri="direct:SendErrorResponse"/>   
            <to uri="xslt:xsl/octopusfault/MakeExceptionResponse.xsl" />           
            <to uri="xslt:xsl/AddOctNamespace.xsl" />
            <setFaultBody>
                <simple>${body}</simple>
            </setFaultBody>            
            <setOutHeader headerName="Exchange.HTTP_RESPONSE_CODE">
                <constant>500</constant>
            </setOutHeader>
</route>
but instead of a soap fault i get a normal soap response, and http response code is "HTTP/1.1 200 OK"
Is there something else that i have to add?
Regards, 
LAji


Re: Generating SoapFault from Spring DSL

Posted by Claus Ibsen <cl...@gmail.com>.
Use <setHeader> instead of <setOutHeader>. The latter is also deprecated

See also this FAQ
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

On Fri, Feb 20, 2015 at 10:04 AM, L F <l8...@yahoo.com.invalid> wrote:
> Hi
> I'm trying to implement a webservice operation as a camel route (spring DSL), and I'd  like to generate a soap fault from the route, when some condition is met. I created a route which should prepare this soap fault :
> <route id="SendErrorResponse">
>             <from uri="direct:SendErrorResponse"/>
>             <to uri="xslt:xsl/octopusfault/MakeExceptionResponse.xsl" />
>             <to uri="xslt:xsl/AddOctNamespace.xsl" />
>             <setFaultBody>
>                 <simple>${body}</simple>
>             </setFaultBody>
>             <setOutHeader headerName="Exchange.HTTP_RESPONSE_CODE">
>                 <constant>500</constant>
>             </setOutHeader>
> </route>
> but instead of a soap fault i get a normal soap response, and http response code is "HTTP/1.1 200 OK"
> Is there something else that i have to add?
> Regards,
> LAji
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/