How to set `throwExceptionOnFailure ` to cxf REST client?

Solution Unverified - Updated -

Issue

  • How to set throwExceptionOnFailure to cxf REST client?
  • throwExceptionOnFailure set to false is not working when calling REST service
  • I have a camel route which needs to call a rest service and I am expected to get a http 400 back with a fault data structure back as response.
  • My route should send it back as it is to the source calling the service.I have set the throwExceptionOnFailure value to false while calling the target REST service, but still exception is being thrown.
  • Part in Blueprint where REST service is called:
<to uri="cxfrs:bean:getUserClient" />

Part where the rsClient is defined:
<cxf:rsClient id="getUserClient"
        address="http://localhost/ownerservices/acct/1.0/getUser?bridgeEndpoint=true&throwExceptionOnFailure=false"
        serviceClass="com.xxx.service.GetyyyService"
        loggingFeatureEnabled="true">

        <cxf:providers>
            <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" />
        </cxf:providers>
        <cxf:headers>
            <entry key="Content-Type" value="application/json" />
        </cxf:headers>
    </cxf:rsClient>

Environment

  • Red Hat JBoss Fuse
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In