Modified: websites/production/camel/content/cxfrs.html
==============================================================================
--- websites/production/camel/content/cxfrs.html (original)
+++ websites/production/camel/content/cxfrs.html Fri Aug 25 08:22:01 2017
@@ -36,17 +36,6 @@
     <![endif]-->
 
 
-  <link href='//camel.apache.org/styles/highlighter/styles/shCoreCamel.css' 
rel='stylesheet' type='text/css' />
-  <link href='//camel.apache.org/styles/highlighter/styles/shThemeCamel.css' 
rel='stylesheet' type='text/css' />
-  <script src='//camel.apache.org/styles/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-  <script src='//camel.apache.org/styles/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-  
-  <script type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
     <title>
     Apache Camel: CXFRS
@@ -86,103 +75,28 @@
        <tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="CXFRS-CXFRSComponent">CXFRS 
Component</h2><div class="confluence-information-macro 
confluence-information-macro-note"><span class="aui-icon aui-icon-small 
aui-iconfont-warning confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>When using CXF as a consumer, the 
<a shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows 
you to factor out how message payloads are received from their processing as a 
RESTful or SOAP web service. This has the potential of using a multitude of 
transports to consume web services. The bean component's configuration is also 
simpler and provides the fastest method to implement web services using Camel 
and CXF.</p></div></div><p>The <strong>cxfrs:</strong> component provides 
integration with <a shape="rect" href="http://cxf.apache.org";>Apache CXF</a> 
for connecting to JAX-RS 1.1 and 2.0 services hosted in CXF.</p><p>Maven users 
will need to add the following
  dependency to their pom.xml for this component:</p><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[&lt;dependency&gt;
+<div class="wiki-content maincontent"><h2 id="CXFRS-CXFRSComponent">CXFRS 
Component</h2><rich-text-body><p>When using CXF as a consumer, the <a 
shape="rect" href="cxf-bean-component.html">CXF Bean Component</a> allows you 
to factor out how message payloads are received from their processing as a 
RESTful or SOAP web service. This has the potential of using a multitude of 
transports to consume web services. The bean component's configuration is also 
simpler and provides the fastest method to implement web services using Camel 
and CXF.</p></rich-text-body><p>The <strong>cxfrs:</strong> component provides 
integration with <a shape="rect" href="http://cxf.apache.org";>Apache CXF</a> 
for connecting to JAX-RS 1.1 and 2.0 services hosted in CXF.</p><p>Maven users 
will need to add the following dependency to their pom.xml for this 
component:</p><parameter 
ac:name="">xml</parameter><plain-text-body>&lt;dependency&gt;
    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
    &lt;artifactId&gt;camel-cxf&lt;/artifactId&gt;
    &lt;version&gt;x.x.x&lt;/version&gt;  &lt;!-- use the same version as your 
Camel core version --&gt;
 &lt;/dependency&gt;
-]]></script>
-</div></div><h3 id="CXFRS-URIformat">URI format</h3><div class="code panel 
pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[cxfrs://address?options
-]]></script>
-</div></div><p>Where <strong>address</strong> represents the CXF endpoint's 
address</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[cxfrs:bean:rsEndpoint
-]]></script>
-</div></div><p>Where <strong>rsEndpoint</strong> represents the spring bean's 
name which presents the CXFRS client or server</p><p>For either style above, 
you can append options to the URI as follows:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[cxfrs:bean:cxfEndpoint?resourceClasses=org.apache.camel.rs.Example
-]]></script>
-</div></div><h3 id="CXFRS-Options">Options</h3><div class="table-wrap"><table 
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Example</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Required?</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>default value</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>resourceClasses</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>The resource classes which you 
want to export as REST service. Multiple classes can be separated by 
comma.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>resourceClasses=org.apache.camel.rs.Example1,</code><br
 clear="none"> <code>org.apache.camel.rs.Exchange2</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" 
 class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>resourceClass</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: 
Use <code>resourceClasses</code> The resource class which you want to export as 
REST service.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>resourceClass 
=org.apache.camel.rs.Example1</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>httpClientAPI</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>new to Camel 
2.1</strong> If it is true, the CxfRsProducer will use the HttpClientAPI to 
invoke the service <br clear="none" class="atl-forced-newline"> If it is false, 
the CxfRsProducer will use the ProxyClientAPI to invoke the service</p></td><td 
colspan="1" r
 owspan="1" class="confluenceTd"><p>httpClientAPI=true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>true</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>synchronous</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>This option will let you decide 
to use sync or async API to do the underlying work. The default value is false 
which means it will try to use async API by default.</p><p>This option is 
available as of <strong>2.5</strong> for CxfRsConsumer and as of 
<strong>2.19</strong> for CxfRsProducer.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>synchronous=true</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>throwExceptionOnFailure</code></p></td><td 
colspan="1" rowspan="1" class="conflu
 enceTd"><p>New in 2.6, this option tells the CxfRsProducer to inspect return 
codes and will generate an Exception if the return code is larger than 
207.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>throwExceptionOnFailure=true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>true</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>maxClientCacheSize</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>New in 2.6, you can set a IN message header 
CamelDestinationOverrideUrl to dynamically override the target destination Web 
Service or REST Service defined in your routes.&#160; The implementation caches 
CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.&#160; This 
option allows you to configure the maximum size of the cache.</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>maxClientCacheSize=5</p></td><td colspan="1" 
rowspan="1" class=
 "confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>10</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>setDefaultBus</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>New in 2.9.0. <strong>deprecated</strong> 
use defaultBus option from Camel 2.16 onwards. Will set the default bus when 
CXF endpoint create a bus by itself</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>setDefaultBus=true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>false</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><code>defaultBus</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span>Will set 
the default bus when CXF endpoint create a bus by itself</span></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><code>defaultBus=true</code></td><td colspan="1" 
rowspan="1" class="
 confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bus</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>New in 2.9.0. A default bus created by CXF Bus Factory. 
Use <code>#</code> notation to reference a bus object from the registry. The 
referenced object must be an instance of 
<code>org.apache.cxf.Bus</code>.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bus=#busName</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>bindingStyle</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>As of 2.11</strong>. 
Sets how requests and responses will be mapped to/from Camel. Two values are 
possible:</p><ul class="alternate"><li><code>SimpleConsumer</code> =&gt; see th
 e <a shape="rect" 
href="#CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request 
with the Simple Binding Style</a> below.</li><li><code>Default</code> =&gt; the 
default style. For consumers this passes on a <code>MessageContentsList</code> 
to the route, requiring low-level processing in the route.</li><li><span 
style="font-family: monospace;">Custom</span> =&gt; allows you to specify a 
custom binding through the <code>binding</code> option.</li></ul></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bindingStyle=SimpleConsumer</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em>Default</em></p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span>binding</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd">Allows you to specify a custom 
<code>CxfRsBinding</code> implementation to perform low-level processing of the 
raw CXF request a
 nd response objects. The implementation must be bound in the Camel registry, 
and you must use the hash (#) notation to refer to it.</td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><code><span>binding=#myBinding</span></code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>DefaultCxfRsBinding</code></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">providers</span></code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
2.12.2</strong><span style="line-height: 1.4285715;"> set custom JAX-RS 
providers list to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>providers=#MyProviders</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">None</em
 ></p></td></tr><tr><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code><span style="line-height: 
 >1.4285715;">schemaLocations</span></code></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
 >2.12.2</strong><span style="line-height: 1.4285715;"> Sets the locations of 
 >the schemas which can be used to validate the incoming XML or JAXB-driven 
 >JSON.</span></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code>schemaLocations=#MySchemaLocations</code></p></td><td
 > colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
 >rowspan="1" class="confluenceTd"><p><em style="line-height: 
 >1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><code><span style="line-height: 
 >1.4285715;">features</span></code></p></td><td colspan="1" rowspan="1" 
 >class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
 >2.12.3</strong><span style="line-height: 1.4285715;"
 > Set the feature list to the CxfRs endpoint.</span></p></td><td colspan="1" 
 > rowspan="1" 
 > class="confluenceTd"><p><code>features=#MyFeatures</code></p></td><td 
 > colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
 > rowspan="1" class="confluenceTd"><p><em style="line-height: 
 > 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
 > class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" 
 > rowspan="1" class="confluenceTd"><p><strong style="line-height: 
 > 1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 
 > 1.4285715;"> Set the properties to the CxfRs endpoint.</span></p></td><td 
 > colspan="1" rowspan="1" 
 > class="confluenceTd"><p><code>properties=#MyProperties</code></p></td><td 
 > colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
 > rowspan="1" class="confluenceTd"><p><em style="line-height: 
 > 1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
 > class="confluenceTd"><p><code>inInterceptors</code></p></td><
 td colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the inInterceptors to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>inInterceptors=#MyInterceptors</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outInterceptors</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the outInterceptor to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">outInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class="conf
 luenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span>inFaultInterceptors</span></code></p></td><td
 colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the inFaultInterceptors to the CxfRs endpoint.</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">inFaultInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;">No</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outFaultIntercetpros</code></p></td><td colspan=
 "1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the outFaultInterceptors to the CxfRs endpoint.</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">outFaultInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;">No</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>continuationTimeout</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;"><strong>Since</strong>&#160;</span><strong style="line-height: 
1.4285715;">Camel 2.14.0&#160;</strong><span style="line-height: 
1.4285715;">This option is used to set the CXF continuation timeout which could 
be used in CxfC
 onsumer by default when the CXF server is using Jetty or Servlet transport. 
(Before&#160;</span><strong style="line-height: 1.4285715;">Camel 
2.14.0</strong><span style="line-height: 1.4285715;">, CxfConsumer just set the 
continuation timeout to be 0, which means the continuation suspend operation 
never timeout.)</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">continuationTimeout=800000</span></code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">30000</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>ignoreDeleteMethodMessageBody</code></td><td 
colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 
2.14.1</strong> This option is used to tell CxfRsProducer to ignore the message 
body of the DELETE method when using HTTP API.</td><td colspan="1" rowspan="1" 
class="confluenceTd
 "><code><span>ignoreDeleteMethodMessageBody=true</span></code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>modelRef</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.14.2</strong> This 
option is used to specify the <a shape="rect" 
href="http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations";>model
 file</a> which is useful for the resource class without 
annotation.</p><p><strong>Since Camel 2.15</strong> This option can point to a 
model file without specifying a service class for emulating document-only 
endpoints</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>modelRef=</code><a shape="rect" 
class="external-link" 
href="http://classpath/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml";
 rel="nofollow" style="fo
 nt-family: monospace;line-height: 
1.4285715;">classpath:/CustomerServiceModel.xml</a></p></td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>None</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p class="p1"><code>performInvocation</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> 
When the option is true, camel will perform the invocation of the resource 
class instance and put the response object into the exchange for further 
processing.</td><td colspan="1" rowspan="1" class="confluenceTd"><p 
class="p1"><code>performInvocation= true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>propagateContexts</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the 
optio
 n is true, JAXRS <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/UriInfo.html";
 rel="nofollow">UriInfo</a>, <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/HttpHeaders.html";
 rel="nofollow">HttpHeaders</a>, <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/Request.html";
 rel="nofollow">Request</a> and <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/SecurityContext.html";
 rel="nofollow">SecurityContext</a> contexts will be available to custom CXFRS 
processors as typed Camel exchange properties. These contexts can be used to 
analyze the current requests using JAX-RS API.</td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="conf
 luenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>loggingFeatureEnabled</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">This option enables CXF Logging Feature which 
writes inbound and outbound REST messages to log.</td><td colspan="1" 
rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>skipFaultLogging</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">This option controls whether the 
<code>PhaseInterceptorChain</code> skips logging the Fault that it 
catches.</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>loggingSizeLimit</code></td><td colspan="1" 
 rowspan="1" class="confluenceTd">To limit the total size of number of bytes 
the logger will output when logging feature has been enabled.</td><td 
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>0</code></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>cookieHandler</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">Since <strong>Camel 2.19.0</strong> Configure a cookie 
handler to maintain a HTTP session</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>cookieHandler=#exchangeCookieHandler</code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>None</em></td></tr></tbody></table></div><p>You can 
also configure the CXF REST endpoint through the spring configuration. Since 
there are lots of difference between the CXF REST client and CXF REST Server, 
we provide different
  configuration for them.<br clear="none"> Please check out the <a shape="rect" 
class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd";>schema
 file</a> and <a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAX-RS documentation</a> 
for more information.</p><h3 
id="CXFRS-HowtoconfiguretheRESTendpointinCamel">How to configure the REST 
endpoint in Camel</h3><p>In <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd";>camel-cxf
 schema file</a>, there are two elements for the REST endpoint definition. 
<strong>cxf:rsServer</strong> for REST consumer, <strong>cxf:rsClient</strong> 
for REST producer.<br clear="none"> You can find a Camel REST service route 
configuration example here.</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pd
 l">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-&lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
-       xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
-       xmlns:cxf=&quot;http://camel.apache.org/schema/cxf&quot;
-       xmlns:jaxrs=&quot;http://cxf.apache.org/jaxrs&quot;
-       xsi:schemaLocation=&quot;
-       http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans.xsd
-       http://camel.apache.org/schema/cxf 
http://camel.apache.org/schema/cxf/camel-cxf.xsd
-       http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
-       http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
-    &quot;&gt;
-
-    &lt;bean 
class=&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;/&gt;
-
-  &lt;!-- Defined the real JAXRS back end service  --&gt;
-  &lt;jaxrs:server id=&quot;restService&quot;
-                       
address=&quot;http://localhost:${CXFTestSupport.port2}/CxfRsRouterTest/rest&quot;
 
-                       staticSubresourceResolution=&quot;true&quot;&gt;
-    &lt;jaxrs:serviceBeans&gt;
-      &lt;ref bean=&quot;customerService&quot;/&gt;
-    &lt;/jaxrs:serviceBeans&gt;       
-  &lt;/jaxrs:server&gt;
-  
-  &lt;bean id=&quot;jsonProvider&quot; 
class=&quot;org.apache.cxf.jaxrs.provider.json.JSONProvider&quot;/&gt;
-
-  &lt;bean id=&quot;customerService&quot; 
class=&quot;org.apache.camel.component.cxf.jaxrs.testbean.CustomerService&quot; 
/&gt;
-   
-  &lt;!-- Defined the server endpoint to create the cxf-rs consumer --&gt; 
-  &lt;cxf:rsServer id=&quot;rsServer&quot; 
address=&quot;http://localhost:${CXFTestSupport.port1}/CxfRsRouterTest/route&quot;
-    
serviceClass=&quot;org.apache.camel.component.cxf.jaxrs.testbean.CustomerService&quot;
 
-    loggingFeatureEnabled=&quot;true&quot; loggingSizeLimit=&quot;20&quot; 
skipFaultLogging=&quot;true&quot;&gt;
-    &lt;cxf:providers&gt;
-       &lt;ref bean=&quot;jsonProvider&quot;/&gt;
-    &lt;/cxf:providers&gt;
-  &lt;/cxf:rsServer&gt;
-
-  &lt;!-- Defined the client endpoint to create the cxf-rs producer --&gt;
-  &lt;cxf:rsClient id=&quot;rsClient&quot; 
address=&quot;http://localhost:${CXFTestSupport.port2}/CxfRsRouterTest/rest&quot;
-    
serviceClass=&quot;org.apache.camel.component.cxf.jaxrs.testbean.CustomerService&quot;
-    loggingFeatureEnabled=&quot;true&quot; 
skipFaultLogging=&quot;true&quot;&gt;
-    &lt;cxf:providers&gt;
-       &lt;ref bean=&quot;jsonProvider&quot;/&gt;
-    &lt;/cxf:providers&gt;
-  &lt;/cxf:rsClient&gt;
-  
-  &lt;!-- The camel route context --&gt;
-  &lt;camelContext id=&quot;camel&quot; 
xmlns=&quot;http://camel.apache.org/schema/spring&quot;&gt;
-    &lt;route&gt;
-       &lt;!-- Just need to ignoreDeleteMethodMessageBody --&gt;
-       &lt;from uri=&quot;cxfrs://bean://rsServer&quot;/&gt;
-       &lt;to uri=&quot;log:body?level=INFO&quot;/&gt;
-       &lt;to 
uri=&quot;cxfrs://bean://rsClient?ignoreDeleteMethodMessageBody=true&amp;amp;synchronous=true&quot;/&gt;
-    &lt;/route&gt;
-  &lt;/camelContext&gt;
-  
-&lt;/beans&gt;
-]]></script>
-</div></div><h3 
id="CXFRS-HowtooverridetheCXFproduceraddressfrommessageheader">How to override 
the CXF producer address from message 
header</h3><p>The&#160;<code>camel-cxfrs</code>&#160;producer supports to 
override the services address by setting the message with the key of 
"<span>CamelDestinationOverrideUrl".</span></p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[ // set up the service address from the 
message header to override the setting of CXF endpoint
+</plain-text-body><h3 id="CXFRS-URIformat">URI format</h3><parameter 
ac:name="language">java</parameter><plain-text-body>cxfrs://address?options
+</plain-text-body><p>Where <strong>address</strong> represents the CXF 
endpoint's address</p><parameter 
ac:name="language">java</parameter><plain-text-body>cxfrs:bean:rsEndpoint
+</plain-text-body><p>Where <strong>rsEndpoint</strong> represents the spring 
bean's name which presents the CXFRS client or server</p><p>For either style 
above, you can append options to the URI as follows:</p><parameter 
ac:name="language">java</parameter><plain-text-body>cxfrs:bean:cxfEndpoint?resourceClasses=org.apache.camel.rs.Example
+</plain-text-body><h3 id="CXFRS-Options">Options</h3><div 
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" 
rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Description</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Example</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>Required?</p></th><th colspan="1" rowspan="1" 
class="confluenceTh"><p>default value</p></th></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>resourceClasses</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>The resource classes which you 
want to export as REST service. Multiple classes can be separated by 
comma.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>resourceClasses=org.apache.camel.rs.Example1,</code><br
 clear="none"> <code>org.apache.camel.rs.Exchange2</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspa
 n="1" class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>resourceClass</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Deprecated</strong>: 
Use <code>resourceClasses</code> The resource class which you want to export as 
REST service.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>resourceClass 
=org.apache.camel.rs.Example1</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>httpClientAPI</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>new to Camel 
2.1</strong> If it is true, the CxfRsProducer will use the HttpClientAPI to 
invoke the service <br clear="none" class="atl-forced-newline"> If it is false, 
the CxfRsProducer will use the ProxyClientAPI to invoke the service</p></td><td 
colspan
 ="1" rowspan="1" class="confluenceTd"><p>httpClientAPI=true</p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em>true</em></p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>synchronous</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>This option will let you decide to use sync 
or async API to do the underlying work. The default value is false which means 
it will try to use async API by default.</p><p>This option is available as of 
<strong>2.5</strong> for CxfRsConsumer and as of <strong>2.19</strong> for 
CxfRsProducer.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>synchronous=true</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>throwExceptionOnFailure</code></p></td><td 
colspan="1" rowspan="1" class="
 confluenceTd"><p>New in 2.6, this option tells the CxfRsProducer to inspect 
return codes and will generate an Exception if the return code is larger than 
207.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>throwExceptionOnFailure=true</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>true</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>maxClientCacheSize</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>New in 2.6, you can set a IN message header 
CamelDestinationOverrideUrl to dynamically override the target destination Web 
Service or REST Service defined in your routes.&#160; The implementation caches 
CXF clients or ClientFactoryBean in CxfProvider and CxfRsProvider.&#160; This 
option allows you to configure the maximum size of the cache.</p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p>maxClientCacheSize=5</p></td><td colspan="1" 
rowspan="1" 
 class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>10</p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>setDefaultBus</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>New in 2.9.0. <strong>deprecated</strong> 
use defaultBus option from Camel 2.16 onwards. Will set the default bus when 
CXF endpoint create a bus by itself</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>setDefaultBus=true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>false</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><code>defaultBus</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> <span>Will set 
the default bus when CXF endpoint create a bus by itself</span></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><code>defaultBus=true</code></td><td colspan="1" 
rowspan="1" c
 lass="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bus</code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p>New in 2.9.0. A default bus created by CXF Bus Factory. 
Use <code>#</code> notation to reference a bus object from the registry. The 
referenced object must be an instance of 
<code>org.apache.cxf.Bus</code>.</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bus=#busName</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em>None</em></p></td></tr><tr><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code>bindingStyle</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><strong>As of 2.11</strong>. 
Sets how requests and responses will be mapped to/from Camel. Two values are 
possible:</p><ul class="alternate"><li><code>SimpleConsumer</code> =&gt; 
 see the <a shape="rect" 
href="#CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request 
with the Simple Binding Style</a> below.</li><li><code>Default</code> =&gt; the 
default style. For consumers this passes on a <code>MessageContentsList</code> 
to the route, requiring low-level processing in the route.</li><li><span 
style="font-family: monospace;">Custom</span> =&gt; allows you to specify a 
custom binding through the <code>binding</code> option.</li></ul></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>bindingStyle=SimpleConsumer</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em>Default</em></p></td></tr><tr><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span>binding</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd">Allows you to specify a custom 
<code>CxfRsBinding</code> implementation to perform low-level processing of the 
raw CXF req
 uest and response objects. The implementation must be bound in the Camel 
registry, and you must use the hash (#) notation to refer to it.</td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><code><span>binding=#myBinding</span></code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>DefaultCxfRsBinding</code></td></tr><tr><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">providers</span></code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
2.12.2</strong><span style="line-height: 1.4285715;"> set custom JAX-RS 
providers list to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>providers=#MyProviders</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 1.4285715;">No
 ne</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">schemaLocations</span></code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
2.12.2</strong><span style="line-height: 1.4285715;"> Sets the locations of the 
schemas which can be used to validate the incoming XML or JAXB-driven 
JSON.</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>schemaLocations=#MySchemaLocations</code></p></td><td
 colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">features</span></code></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><strong style="line-height: 1.4285715;">Since Camel 
2.12.3</strong><span style="line-height: 1.428
 5715;"> Set the feature list to the CxfRs endpoint.</span></p></td><td 
colspan="1" rowspan="1" 
class="confluenceTd"><p><code>features=#MyFeatures</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>properties</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the properties to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" 
class="confluenceTd"><p><code>properties=#MyProperties</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>inInterceptors</code></p>
 </td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong 
style="line-height: 1.4285715;">Since Camel 2.12.4</strong><span 
style="line-height: 1.4285715;"> Set the inInterceptors to the CxfRs 
endpoint.</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>inInterceptors=#MyInterceptors</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outInterceptors</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the outInterceptor to the CxfRs endpoint.</span></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">outInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class
 ="confluenceTd"><p><span style="line-height: 1.4285715;">No</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span>inFaultInterceptors</span></code></p></td><td
 colspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the inFaultInterceptors to the CxfRs endpoint.</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">inFaultInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;">No</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>outFaultIntercetpros</code></p></td><td co
 lspan="1" rowspan="1" class="confluenceTd"><p><strong style="line-height: 
1.4285715;">Since Camel 2.12.4</strong><span style="line-height: 1.4285715;"> 
Set the outFaultInterceptors to the CxfRs endpoint.</span></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">outFaultInterceptors=#MyInterceptors</span></code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;">No</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">None</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>continuationTimeout</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><p><span style="line-height: 
1.4285715;"><strong>Since</strong>&#160;</span><strong style="line-height: 
1.4285715;">Camel 2.14.0&#160;</strong><span style="line-height: 
1.4285715;">This option is used to set the CXF continuation timeout which could 
be used i
 n CxfConsumer by default when the CXF server is using Jetty or Servlet 
transport. (Before&#160;</span><strong style="line-height: 1.4285715;">Camel 
2.14.0</strong><span style="line-height: 1.4285715;">, CxfConsumer just set the 
continuation timeout to be 0, which means the continuation suspend operation 
never timeout.)</span></p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code><span style="line-height: 
1.4285715;">continuationTimeout=800000</span></code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p>No</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><em style="line-height: 
1.4285715;">30000</em></p></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>ignoreDeleteMethodMessageBody</code></td><td 
colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 
2.14.1</strong> This option is used to tell CxfRsProducer to ignore the message 
body of the DELETE method when using HTTP API.</td><td colspan="1" rowspan="1" 
class="conflu
 enceTd"><code><span>ignoreDeleteMethodMessageBody=true</span></code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>modelRef</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd"><p><strong>Since Camel 2.14.2</strong> This 
option is used to specify the <a shape="rect" 
href="http://cxf.apache.org/docs/jax-rs-advanced-features.html#JAX-RSAdvancedFeatures-RESTfulserviceswithoutannotations";>model
 file</a> which is useful for the resource class without 
annotation.</p><p><strong>Since Camel 2.15</strong> This option can point to a 
model file without specifying a service class for emulating document-only 
endpoints</p></td><td colspan="1" rowspan="1" 
class="confluenceTd"><p><code>modelRef=</code><a shape="rect" 
class="external-link" 
href="http://classpath/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml";
 rel="nofollow" sty
 le="font-family: monospace;line-height: 
1.4285715;">classpath:/CustomerServiceModel.xml</a></p></td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>None</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><p class="p1"><code>performInvocation</code></p></td><td 
colspan="1" rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> 
When the option is true, camel will perform the invocation of the resource 
class instance and put the response object into the exchange for further 
processing.</td><td colspan="1" rowspan="1" class="confluenceTd"><p 
class="p1"><code>performInvocation= true</code></p></td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>propagateContexts</code></td><td colspan="1" 
rowspan="1" class="confluenceTd"><strong>Since Camel 2.15</strong> When the
  option is true, JAXRS <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/UriInfo.html";
 rel="nofollow">UriInfo</a>, <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/HttpHeaders.html";
 rel="nofollow">HttpHeaders</a>, <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/Request.html";
 rel="nofollow">Request</a> and <a shape="rect" class="external-link" 
href="https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/core/SecurityContext.html";
 rel="nofollow">SecurityContext</a> contexts will be available to custom CXFRS 
processors as typed Camel exchange properties. These contexts can be used to 
analyze the current requests using JAX-RS API.</td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class
 ="confluenceTd">&#160;</td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>loggingFeatureEnabled</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">This option enables CXF Logging Feature which 
writes inbound and outbound REST messages to log.</td><td colspan="1" 
rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" 
class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>skipFaultLogging</code></td><td colspan="1" 
rowspan="1" class="confluenceTd">This option controls whether the 
<code>PhaseInterceptorChain</code> skips logging the Fault that it 
catches.</td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>false</em></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>loggingSizeLimit</code></td><td colspa
 n="1" rowspan="1" class="confluenceTd">To limit the total size of number of 
bytes the logger will output when logging feature has been enabled.</td><td 
colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" 
rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>0</code></td></tr><tr><td colspan="1" rowspan="1" 
class="confluenceTd"><code>cookieHandler</code></td><td colspan="1" rowspan="1" 
class="confluenceTd">Since <strong>Camel 2.19.0</strong> Configure a cookie 
handler to maintain a HTTP session</td><td colspan="1" rowspan="1" 
class="confluenceTd"><code>cookieHandler=#exchangeCookieHandler</code></td><td 
colspan="1" rowspan="1" class="confluenceTd">No</td><td colspan="1" rowspan="1" 
class="confluenceTd"><em>None</em></td></tr></tbody></table></div><p>You can 
also configure the CXF REST endpoint through the spring configuration. Since 
there are lots of difference between the CXF REST client and CXF REST Server, 
we provide dif
 ferent configuration for them.<br clear="none"> Please check out the <a 
shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd";>schema
 file</a> and <a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAX-RS documentation</a> 
for more information.</p><h3 
id="CXFRS-HowtoconfiguretheRESTendpointinCamel">How to configure the REST 
endpoint in Camel</h3><p>In <a shape="rect" class="external-link" 
href="http://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/main/resources/schema/cxfEndpoint.xsd";>camel-cxf
 schema file</a>, there are two elements for the REST endpoint definition. 
<strong>cxf:rsServer</strong> for REST consumer, <strong>cxf:rsClient</strong> 
for REST producer.<br clear="none"> You can find a Camel REST service route 
configuration example 
here.<plain-text-body>{snippet:id=cxfRsExample|lang=xml|url=camel/trunk/components/camel-cxf/src/
 
test/resources/org/apache/camel/component/cxf/jaxrs/CxfRsSpringRouter.xml}</plain-text-body></p><h3
 id="CXFRS-HowtooverridetheCXFproduceraddressfrommessageheader">How to override 
the CXF producer address from message 
header</h3><p>The&#160;<code>camel-cxfrs</code>&#160;producer supports to 
override the services address by setting the message with the key of 
"<span>CamelDestinationOverrideUrl".</span></p><plain-text-body> // set up the 
service address from the message header to override the setting of CXF endpoint
  exchange.getIn().setHeader(Exchange.DESTINATION_OVERRIDE_URL, 
constant(getServiceAddress()));
-]]></script>
-</div></div><h3 id="CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming 
a REST Request - Simple Binding Style</h3><p><strong>Available as of Camel 
2.11</strong></p><p>The <code>Default</code> binding style is rather low-level, 
requiring the user to manually process the <code>MessageContentsList</code> 
object coming into the route. Thus, it tightly couples the route logic with the 
method signature and parameter indices of the JAX-RS operation. Somewhat 
inelegant, difficult and error-prone.</p><p>In contrast, the 
<code>SimpleConsumer</code> binding style performs the following mappings, in 
order to <strong>make the request data more accessible</strong> to you within 
the Camel Message:</p><ul><li>JAX-RS Parameters (@HeaderParam, @QueryParam, 
etc.) are injected as IN message headers. The header name matches the value of 
the annotation.</li><li>The request entity (POJO or other type) becomes the IN 
message body. If a single entity cannot be identified in the JAX-RS method 
signature
 , it falls back to the original 
<code>MessageContentsList</code>.</li><li>Binary <code>@Multipart</code> body 
parts become IN message attachments, supporting <code>DataHandler</code>, 
<code>InputStream</code>, <code>DataSource</code> and CXF's 
<code>Attachment</code> class.</li><li>Non-binary <code>@Multipart</code> body 
parts are mapped as IN message headers. The header name matches the Body Part 
name.</li></ul><p>Additionally, the following rules apply to the 
<strong>Response mapping</strong>:</p><ul><li>If the message body type is 
different to <code>javax.ws.rs.core.Response</code> (user-built response), a 
new <code>Response</code> is created and the message body is set as the entity 
(so long it's not null). The response status code is taken from the 
<code>Exchange.HTTP_RESPONSE_CODE</code> header, or defaults to 200 OK if not 
present.</li><li>If the message body type is equal to 
<code>javax.ws.rs.core.Response</code>, it means that the user has built a 
custom response, and there
 fore it is respected and it becomes the final response.</li><li>In all cases, 
Camel headers permitted by custom or default <code>HeaderFilterStrategy</code> 
are added to the HTTP response.</li></ul><h4 
id="CXFRS-EnablingtheSimpleBindingStyle">Enabling the Simple Binding 
Style</h4><p>This binding style can be activated by setting the 
<code>bindingStyle</code> parameter in the consumer endpoint to value 
<code>SimpleConsumer</code>:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[  
from(&quot;cxfrs:bean:rsServer?bindingStyle=SimpleConsumer&quot;)
-    .to(&quot;log:TEST?showAll=true&quot;);
-]]></script>
-</div></div><h4 
id="CXFRS-Examplesofrequestbindingwithdifferentmethodsignatures">Examples of 
request binding with different method signatures</h4><p>Below is a list of 
method signatures along with the expected result from the Simple 
binding.</p><p><strong><code>public Response doAction(BusinessObject 
request);</code></strong><br clear="none"> Request payload is placed in IN 
message body, replacing the original 
MessageContentsList.</p><p><strong><code>public Response 
doAction(BusinessObject request, @HeaderParam("abcd") String abcd, 
@QueryParam("defg") String defg);</code></strong><br clear="none"> Request 
payload placed in IN message body, replacing the original MessageContentsList. 
Both request params mapped as IN message headers with names abcd and 
defg.</p><p><strong><code>public Response doAction(@HeaderParam("abcd") String 
abcd, @QueryParam("defg") String defg);</code></strong><br clear="none"> Both 
request params mapped as IN message headers with names abcd and defg. The origi
 nal MessageContentsList is preserved, even though it only contains the 2 
parameters.</p><p><strong><code>public Response 
doAction(@Multipart(value="body1") BusinessObject request, 
@Multipart(value="body2") BusinessObject request2);</code></strong><br 
clear="none"> The first parameter is transferred as a header with name body1, 
and the second one is mapped as header body2. The original MessageContentsList 
is preserved as the IN message body.</p><p><strong><code>public Response 
doAction(InputStream abcd);</code></strong><br clear="none"> The InputStream is 
unwrapped from the MessageContentsList and preserved as the IN message 
body.</p><p><strong><code>public Response doAction(DataHandler 
abcd);</code></strong><br clear="none"> The DataHandler is unwrapped from the 
MessageContentsList and preserved as the IN message body.</p><h4 
id="CXFRS-MoreexamplesoftheSimpleBindingStyle">More examples of the Simple 
Binding Style</h4><p>Given a JAX-RS resource class with this method:</p><div 
class="
 code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    @POST @Path(&quot;/customers/{type}&quot;)
-    public Response newCustomer(Customer customer, 
@PathParam(&quot;type&quot;) String type, @QueryParam(&quot;active&quot;) 
@DefaultValue(&quot;true&quot;) boolean active) {
+</plain-text-body><h3 
id="CXFRS-ConsumingaRESTRequest-SimpleBindingStyle">Consuming a REST Request - 
Simple Binding Style</h3><p><strong>Available as of Camel 
2.11</strong></p><p>The <code>Default</code> binding style is rather low-level, 
requiring the user to manually process the <code>MessageContentsList</code> 
object coming into the route. Thus, it tightly couples the route logic with the 
method signature and parameter indices of the JAX-RS operation. Somewhat 
inelegant, difficult and error-prone.</p><p>In contrast, the 
<code>SimpleConsumer</code> binding style performs the following mappings, in 
order to <strong>make the request data more accessible</strong> to you within 
the Camel Message:</p><ul><li>JAX-RS Parameters (@HeaderParam, @QueryParam, 
etc.) are injected as IN message headers. The header name matches the value of 
the annotation.</li><li>The request entity (POJO or other type) becomes the IN 
message body. If a single entity cannot be identified in the JAX-RS method sig
 nature, it falls back to the original 
<code>MessageContentsList</code>.</li><li>Binary <code>@Multipart</code> body 
parts become IN message attachments, supporting <code>DataHandler</code>, 
<code>InputStream</code>, <code>DataSource</code> and CXF's 
<code>Attachment</code> class.</li><li>Non-binary <code>@Multipart</code> body 
parts are mapped as IN message headers. The header name matches the Body Part 
name.</li></ul><p>Additionally, the following rules apply to the 
<strong>Response mapping</strong>:</p><ul><li>If the message body type is 
different to <code>javax.ws.rs.core.Response</code> (user-built response), a 
new <code>Response</code> is created and the message body is set as the entity 
(so long it's not null). The response status code is taken from the 
<code>Exchange.HTTP_RESPONSE_CODE</code> header, or defaults to 200 OK if not 
present.</li><li>If the message body type is equal to 
<code>javax.ws.rs.core.Response</code>, it means that the user has built a 
custom response, and
  therefore it is respected and it becomes the final response.</li><li>In all 
cases, Camel headers permitted by custom or default 
<code>HeaderFilterStrategy</code> are added to the HTTP response.</li></ul><h4 
id="CXFRS-EnablingtheSimpleBindingStyle">Enabling the Simple Binding 
Style</h4><p>This binding style can be activated by setting the 
<code>bindingStyle</code> parameter in the consumer endpoint to value 
<code>SimpleConsumer</code>:</p><parameter 
ac:name="language">java</parameter><plain-text-body>  
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
+    .to("log:TEST?showAll=true");
+</plain-text-body><h4 
id="CXFRS-Examplesofrequestbindingwithdifferentmethodsignatures">Examples of 
request binding with different method signatures</h4><p>Below is a list of 
method signatures along with the expected result from the Simple 
binding.</p><p><strong><code>public Response doAction(BusinessObject 
request);</code></strong><br clear="none"> Request payload is placed in IN 
message body, replacing the original 
MessageContentsList.</p><p><strong><code>public Response 
doAction(BusinessObject request, @HeaderParam("abcd") String abcd, 
@QueryParam("defg") String defg);</code></strong><br clear="none"> Request 
payload placed in IN message body, replacing the original MessageContentsList. 
Both request params mapped as IN message headers with names abcd and 
defg.</p><p><strong><code>public Response doAction(@HeaderParam("abcd") String 
abcd, @QueryParam("defg") String defg);</code></strong><br clear="none"> Both 
request params mapped as IN message headers with names abcd and defg. The
  original MessageContentsList is preserved, even though it only contains the 2 
parameters.</p><p><strong><code>public Response 
doAction(@Multipart(value="body1") BusinessObject request, 
@Multipart(value="body2") BusinessObject request2);</code></strong><br 
clear="none"> The first parameter is transferred as a header with name body1, 
and the second one is mapped as header body2. The original MessageContentsList 
is preserved as the IN message body.</p><p><strong><code>public Response 
doAction(InputStream abcd);</code></strong><br clear="none"> The InputStream is 
unwrapped from the MessageContentsList and preserved as the IN message 
body.</p><p><strong><code>public Response doAction(DataHandler 
abcd);</code></strong><br clear="none"> The DataHandler is unwrapped from the 
MessageContentsList and preserved as the IN message body.</p><h4 
id="CXFRS-MoreexamplesoftheSimpleBindingStyle">More examples of the Simple 
Binding Style</h4><p>Given a JAX-RS resource class with this method:</p><param
 eter ac:name="language">java</parameter><plain-text-body>    @POST 
@Path("/customers/{type}")
+    public Response newCustomer(Customer customer, @PathParam("type") String 
type, @QueryParam("active") @DefaultValue("true") boolean active) {
         return null;
     }
-]]></script>
-</div></div><p>Serviced by the following route:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[    
from(&quot;cxfrs:bean:rsServer?bindingStyle=SimpleConsumer&quot;)
-        .recipientList(simple(&quot;direct:${header.operationName}&quot;));
+</plain-text-body><p>Serviced by the following route:</p><parameter 
ac:name="language">java</parameter><plain-text-body>    
from("cxfrs:bean:rsServer?bindingStyle=SimpleConsumer")
+        .recipientList(simple("direct:${header.operationName}"));
 
-    from(&quot;direct:newCustomer&quot;)
-        .log(&quot;Request: type=${header.type}, active=${header.active}, 
customerData=${body}&quot;);
-]]></script>
-</div></div><p>The following HTTP request with XML payload (given that the 
Customer DTO is JAXB-annotated):</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[POST /customers/gold?active=true
+    from("direct:newCustomer")
+        .log("Request: type=${header.type}, active=${header.active}, 
customerData=${body}");
+</plain-text-body><p>The following HTTP request with XML payload (given that 
the Customer DTO is JAXB-annotated):</p><parameter 
ac:name="language">xml</parameter><plain-text-body>POST 
/customers/gold?active=true
 
 Payload:
 &lt;Customer&gt;
@@ -190,135 +104,8 @@ Payload:
   &lt;country&gt;Spain&lt;/country&gt;
   &lt;project&gt;Apache Camel&lt;/project&gt;
 &lt;/Customer&gt;
-]]></script>
-</div></div><p>Will print the message:</p><div class="code panel pdl" 
style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: xml; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[Request: type=gold, active=true, 
customerData=&lt;Customer.toString() representation&gt;
-]]></script>
-</div></div><p>For more examples on how to process requests and write 
responses can be found <a shape="rect" class="external-link" 
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/";>here</a>.</p><h3
 id="CXFRS-ConsumingaRESTRequest-DefaultBindingStyle">Consuming a REST Request 
- Default Binding Style</h3><p>The&#160;<a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS front end</a> 
implements the <a shape="rect" class="external-link" 
href="https://jsr311.java.net/"; rel="nofollow">JAX-RS (JSR-311) API</a>, so we 
can export the resources classes as a REST service. And we leverage the <a 
shape="rect" class="external-link" 
href="http://cwiki.apache.org/confluence/display/CXF20DOC/Invokers";>CXF Invoker 
API</a> to turn a REST request into a normal Java object method invocation.<br 
clear="none"> Unlike the <a shape="rect" href="restlet.html">Camel 
Restlet</a>&#1
 60;component, you don't need to specify the URI template within your endpoint, 
CXF takes care of the REST request URI to resource class method mapping 
according to the JSR-311 specification. All you need to do in Camel is delegate 
this method request to a right processor or endpoint.</p><p>Here is an example 
of a CXFRS route...</p><div class="code panel pdl" style="border-width: 
1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-private static final String CXF_RS_ENDPOINT_URI = 
-        &quot;cxfrs://http://localhost:&quot; + CXT + 
&quot;/rest?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceResource&quot;;
-private static final String CXF_RS_ENDPOINT_URI2 = 
-        &quot;cxfrs://http://localhost:&quot; + CXT + 
&quot;/rest2?resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerService&quot;;
-private static final String CXF_RS_ENDPOINT_URI3 = 
-        &quot;cxfrs://http://localhost:&quot; + CXT + &quot;/rest3?&quot;
-        + 
&quot;resourceClasses=org.apache.camel.component.cxf.jaxrs.testbean.CustomerServiceNoAnnotations&amp;&quot;
-        + 
&quot;modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceModel.xml&quot;;
-private static final String CXF_RS_ENDPOINT_URI4 = 
-        &quot;cxfrs://http://localhost:&quot; + CXT + &quot;/rest4?&quot;
-        + 
&quot;modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceDefaultHandlerModel.xml&quot;;
-private static final String CXF_RS_ENDPOINT_URI5 = 
-        &quot;cxfrs://http://localhost:&quot; + CXT + &quot;/rest5?&quot;
-        + &quot;propagateContexts=true&amp;&quot;
-        + 
&quot;modelRef=classpath:/org/apache/camel/component/cxf/jaxrs/CustomerServiceDefaultHandlerModel.xml&quot;;
-protected RouteBuilder createRouteBuilder() throws Exception {
-    final Processor testProcessor = new TestProcessor();
-    final Processor testProcessor2 = new TestProcessor2();
-    final Processor testProcessor3 = new TestProcessor3();
-    return new RouteBuilder() {
-        public void configure() {
-            errorHandler(new NoErrorHandlerBuilder());
-            from(CXF_RS_ENDPOINT_URI).process(testProcessor);
-            from(CXF_RS_ENDPOINT_URI2).process(testProcessor);
-            from(CXF_RS_ENDPOINT_URI3).process(testProcessor);
-            from(CXF_RS_ENDPOINT_URI4).process(testProcessor2);
-            from(CXF_RS_ENDPOINT_URI5).process(testProcessor3);
-        }
-    };
-}
-]]></script>
-</div></div>And the corresponding resource class used to configure the 
endpoint...<div class="confluence-information-macro 
confluence-information-macro-information"><p class="title">Note about resource 
classes</p><span class="aui-icon aui-icon-small aui-iconfont-info 
confluence-information-macro-icon"></span><div 
class="confluence-information-macro-body"><p>By default, JAX-RS resource 
classes are <strong>only </strong>used to configure JAX-RS properties. Methods 
will <strong>not</strong> be executed during routing of messages to the 
endpoint. Instead, it is the responsibility of the route to do all 
processing.</p><p>Note that starting from Camel 2.15 it is also sufficient to 
provide an interface only as opposed to a no-op service implementation class 
for the default mode.</p><p>Starting from Camel 2.15, if a 
<strong>performInvocation</strong> option is enabled, the service 
implementation will be invoked first, the response will be set on the Camel 
exchange and the route execution wi
 ll continue as usual. This can be useful for</p><p>integrating the existing 
JAX-RS implementations into Camel routes and for post-processing JAX-RS 
Responses in custom processors.</p><p>&#160;</p></div></div><p></p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-@Path(&quot;/customerservice/&quot;)
-public interface CustomerServiceResource {
-
-    @GET
-    @Path(&quot;/customers/{id}/&quot;)
-    Customer getCustomer(@PathParam(&quot;id&quot;) String id);
-
-    @PUT
-    @Path(&quot;/customers/&quot;)
-    Response updateCustomer(Customer customer);
-    
-    @Path(&quot;/{id}&quot;)
-    @PUT()
-    @Consumes({ &quot;application/xml&quot;, &quot;text/plain&quot;,
-                    &quot;application/json&quot; })
-    @Produces({ &quot;application/xml&quot;, &quot;text/plain&quot;,
-                    &quot;application/json&quot; })
-    Object invoke(@PathParam(&quot;id&quot;) String id,
-                    String payload);
-}
-]]></script>
-</div></div><h3 
id="CXFRS-HowtoinvoketheRESTservicethroughcamel-cxfrsproducer">How to invoke 
the REST service through camel-cxfrs producer</h3><p>The&#160;<a shape="rect" 
class="external-link" href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS 
front end</a> implements <a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-Proxy-basedAPI";>a
 proxy-based client API</a>, with this API you can invoke the remote REST 
service through a proxy. The&#160;<code>camel-cxfrs</code> producer is based on 
this <a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-Proxy-basedAPI";>proxy
 API</a>.<br clear="none"> You just need to specify the operation name in the 
message header and prepare the parameter in the message body, the 
<span>camel-cxfrs</span>&#160;producer will generate right REST request for 
you.</p><p>Here is an example:</p><div class="code panel pdl" style="border-widt
 h: 1px;"><div class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-Exchange exchange = template.send(&quot;direct://proxy&quot;, new Processor() {
-    public void process(Exchange exchange) throws Exception {
-        exchange.setPattern(ExchangePattern.InOut);
-        Message inMessage = exchange.getIn();
-        setupDestinationURL(inMessage);
-        // set the operation name 
-        inMessage.setHeader(CxfConstants.OPERATION_NAME, 
&quot;getCustomer&quot;);
-        // using the proxy client API
-        inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, 
Boolean.FALSE);
-        // set a customer header
-        inMessage.setHeader(&quot;key&quot;, &quot;value&quot;);
-        // setup the accept content type
-        inMessage.setHeader(Exchange.ACCEPT_CONTENT_TYPE, 
&quot;application/json&quot;);
-        // set the parameters , if you just have one parameter 
-        // camel will put this object into an Object[] itself
-        inMessage.setBody(&quot;123&quot;);
-    }
-});
-     
-// get the response message 
-Customer response = (Customer) exchange.getOut().getBody();
-
-assertNotNull(&quot;The response should not be null &quot;, response);
-assertEquals(&quot;Get a wrong customer id &quot;, 
String.valueOf(response.getId()), &quot;123&quot;);
-assertEquals(&quot;Get a wrong customer name&quot;, response.getName(), 
&quot;John&quot;);
-assertEquals(&quot;Get a wrong response code&quot;, 200, 
exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
-assertEquals(&quot;Get a wrong header value&quot;, &quot;value&quot;, 
exchange.getOut().getHeader(&quot;key&quot;));
-]]></script>
-</div></div>The&#160;<a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS front end</a> also 
provides <a shape="rect" 
href="https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-CXFWebClientAPI";>a
 http centric client API</a>.&#160;You can also invoke this API from 
<code>camel-cxfrs</code> producer. You need to specify the <a shape="rect" 
class="external-link" 
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#HTTP_PATH";>HTTP_PATH</a>
 and the&#160;<a shape="rect" class="external-link" 
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#HTTP_METHOD";>HTTP_METHOD</a>&#160;and
 let the&#160;producer use the http centric client API by using the URI option 
<strong>httpClientAPI</strong> or by setting the message header <a shape="rect" 
class="external-link" 
href="http://camel.apache.org/maven/current/camel-cxf/apidocs/org/apache/came
 
l/component/cxf/CxfConstants.html#CAMEL_CXF_RS_USING_HTTP_API">CxfConstants.CAMEL_CXF_RS_USING_HTTP_API</a>.
 You can turn the response object to the type class specified with the message 
header&#160;<a shape="rect" class="external-link" 
href="http://camel.apache.org/maven/current/camel-cxf/apidocs/org/apache/camel/component/cxf/CxfConstants.html#CAMEL_CXF_RS_RESPONSE_CLASS";>CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS</a>.<div
 class="code panel pdl" style="border-width: 1px;"><div class="codeContent 
panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-Exchange exchange = template.send(&quot;direct://http&quot;, new Processor() {
-    public void process(Exchange exchange) throws Exception {
-        exchange.setPattern(ExchangePattern.InOut);
-        Message inMessage = exchange.getIn();
-        setupDestinationURL(inMessage);
-        // using the http central client API
-        inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_USING_HTTP_API, 
Boolean.TRUE);
-        // set the Http method
-        inMessage.setHeader(Exchange.HTTP_METHOD, &quot;GET&quot;);
-        // set the relative path
-        inMessage.setHeader(Exchange.HTTP_PATH, 
&quot;/customerservice/customers/123&quot;);                
-        // Specify the response class , cxfrs will use InputStream as the 
response object type 
-        inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS, 
Customer.class);
-        // set a customer header
-        inMessage.setHeader(&quot;key&quot;, &quot;value&quot;);
-        // since we use the Get method, so we don&#39;t need to set the 
message body
-        inMessage.setBody(null);                
-    }
-});
-     
-// get the response message 
-Customer response = (Customer) exchange.getOut().getBody();
-
-assertNotNull(&quot;The response should not be null &quot;, response);
-assertEquals(&quot;Get a wrong customer id &quot;, 
String.valueOf(response.getId()), &quot;123&quot;);
-assertEquals(&quot;Get a wrong customer name&quot;, response.getName(), 
&quot;John&quot;);
-assertEquals(&quot;Get a wrong response code&quot;, 200, 
exchange.getOut().getHeader(Exchange.HTTP_RESPONSE_CODE));
-assertEquals(&quot;Get a wrong header value&quot;, &quot;value&quot;, 
exchange.getOut().getHeader(&quot;key&quot;));
-]]></script>
-</div></div>From Camel 2.1, we also support to specify the query parameters 
from cxfrs URI for the CXFRS http centric client.<div class="error"><span 
class="error">Error formatting macro: snippet: 
java.lang.IndexOutOfBoundsException: Index: 20, Size: 20</span> </div>To 
support the Dynamical routing, you can override the URI's query parameters by 
using the CxfConstants.CAMEL_CXF_RS_QUERY_MAP header to set the parameter map 
for it.<div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<script class="brush: java; gutter: false; theme: Default" 
type="syntaxhighlighter"><![CDATA[
-Map&lt;String, String&gt; queryMap = new LinkedHashMap&lt;String, 
String&gt;();                    
-queryMap.put(&quot;q1&quot;, &quot;new&quot;);
-queryMap.put(&quot;q2&quot;, &quot;world&quot;);                    
-inMessage.setHeader(CxfConstants.CAMEL_CXF_RS_QUERY_MAP, queryMap);
-]]></script>
-</div></div></div>
+</plain-text-body><p>Will print the message:</p><parameter 
ac:name="language">xml</parameter><plain-text-body>Request: type=gold, 
active=true, customerData=&lt;Customer.toString() representation&gt;
+</plain-text-body><p>For more examples on how to process requests and write 
responses can be found <a shape="rect" class="external-link" 
href="https://svn.apache.org/repos/asf/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/simplebinding/";>here</a>.</p><h3
 id="CXFRS-ConsumingaRESTRequest-DefaultBindingStyle">Consuming a REST Request 
- Default Binding Style</h3><p>The&#160;<a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS front end</a> 
implements the <a shape="rect" class="external-link" 
href="https://jsr311.java.net/"; rel="nofollow">JAX-RS (JSR-311) API</a>, so we 
can export the resources classes as a REST service. And we leverage the <a 
shape="rect" class="external-link" 
href="http://cwiki.apache.org/confluence/display/CXF20DOC/Invokers";>CXF Invoker 
API</a> to turn a REST request into a normal Java object method invocation.<br 
clear="none"> Unlike the <a shape="rect" href="restlet.html">Camel Restlet<
 /a>&#160;component, you don't need to specify the URI template within your 
endpoint, CXF takes care of the REST request URI to resource class method 
mapping according to the JSR-311 specification. All you need to do in Camel is 
delegate this method request to a right processor or endpoint.</p><p>Here is an 
example of a CXFRS 
route...<plain-text-body>{snippet:id=example|lang=java|url=camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsConsumerTest.java}</plain-text-body>And
 the corresponding resource class used to configure the 
endpoint...</p><parameter ac:name="title">Note about resource 
classes</parameter><rich-text-body><p>By default, JAX-RS resource classes are 
<strong>only </strong>used to configure JAX-RS properties. Methods will 
<strong>not</strong> be executed during routing of messages to the endpoint. 
Instead, it is the responsibility of the route to do all processing.</p><p>Note 
that starting from Camel 2.15 it is also sufficient to pro
 vide an interface only as opposed to a no-op service implementation class for 
the default mode.</p><p>Starting from Camel 2.15, if a 
<strong>performInvocation</strong> option is enabled, the service 
implementation will be invoked first, the response will be set on the Camel 
exchange and the route execution will continue as usual. This can be useful 
for</p><p>integrating the existing JAX-RS implementations into Camel routes and 
for post-processing JAX-RS Responses in custom 
processors.</p><p>&#160;</p></rich-text-body><p><plain-text-body>{snippet:id=example|lang=java|url=camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/testbean/CustomerServiceResource.java}</plain-text-body></p><h3
 id="CXFRS-HowtoinvoketheRESTservicethroughcamel-cxfrsproducer">How to invoke 
the REST service through camel-cxfrs producer</h3><p>The&#160;<a shape="rect" 
class="external-link" href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS 
front end</a> implements <a shape="re
 ct" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-Proxy-basedAPI";>a
 proxy-based client API</a>, with this API you can invoke the remote REST 
service through a proxy. The&#160;<code>camel-cxfrs</code> producer is based on 
this <a shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-Proxy-basedAPI";>proxy
 API</a>.<br clear="none"> You just need to specify the operation name in the 
message header and prepare the parameter in the message body, the 
<span>camel-cxfrs</span>&#160;producer will generate right REST request for 
you.</p><p>Here is an 
example:<plain-text-body>{snippet:id=ProxyExample|lang=java|url=camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java}</plain-text-body>The&#160;<a
 shape="rect" class="external-link" 
href="https://cwiki.apache.org/CXF20DOC/JAX-RS";>CXF JAXRS front end</a> also 
provides <a shape="rect" href="ht
 
tps://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Client+API#JAX-RSClientAPI-CXFWebClientAPI">a
 http centric client API</a>.&#160;You can also invoke this API from 
<code>camel-cxfrs</code> producer. You need to specify the <a shape="rect" 
class="external-link" 
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#HTTP_PATH";>HTTP_PATH</a>
 and the&#160;<a shape="rect" class="external-link" 
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/Exchange.html#HTTP_METHOD";>HTTP_METHOD</a>&#160;and
 let the&#160;producer use the http centric client API by using the URI option 
<strong>httpClientAPI</strong> or by setting the message header <a shape="rect" 
class="external-link" 
href="http://camel.apache.org/maven/current/camel-cxf/apidocs/org/apache/camel/component/cxf/CxfConstants.html#CAMEL_CXF_RS_USING_HTTP_API";>CxfConstants.CAMEL_CXF_RS_USING_HTTP_API</a>.
 You can turn the response object to the type class specified
  with the message header&#160;<a shape="rect" class="external-link" 
href="http://camel.apache.org/maven/current/camel-cxf/apidocs/org/apache/camel/component/cxf/CxfConstants.html#CAMEL_CXF_RS_RESPONSE_CLASS";>CxfConstants.CAMEL_CXF_RS_RESPONSE_CLASS</a>.<plain-text-body>{snippet:id=HttpExample|lang=java|url=camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java}</plain-text-body>From
 Camel 2.1, we also support to specify the query parameters from cxfrs URI for 
the CXFRS http centric 
client.<plain-text-body>{snippet:id=QueryExample|lang=java|url=camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java}</plain-text-body>To
 support the Dynamical routing, you can override the URI's query parameters by 
using the CxfConstants.CAMEL_CXF_RS_QUERY_MAP header to set the parameter map 
for 
it.<plain-text-body>{snippet:id=QueryMapExample|lang=java|url=camel/trunk/components/camel-cxf/src/test/jav
 
a/org/apache/camel/component/cxf/jaxrs/CxfRsProducerTest.java}</plain-text-body></p></div>
         </td>
         <td valign="top">
           <div class="navigation">


Reply via email to