Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Some wording changes, add links to the Jetty component.

...

The cxfbean: component allows other Camel endpoints to send exchange and invoke Web service bean objects. (Currently, it only supports JAXRS, JAXWSJAX-RS and JAX-WS (new to camel2Camel 2.1) annotated service beanbeans.)

Info

CxfBeanEndpoint is a ProcessorEndpoint so it has no consumers. It works similarly to a Bean component.

...

Wiki Markup
{div:class=confluenceTableSmall}
|| Name || Description || Type || Required? || Default Value || In/Out || Examples ||
| {{CamelHttpCharacterEncoding}} (before 2.0-m2: {{CamelCxfBeanCharacterEncoding}}) | Character encoding | {{String}} | No | None | In | ISO-8859-1 |
| {{CamelContentType}} (before 2.0-m2: {{CamelCxfBeanContentType}}) | Content type | {{String}} | No | \**/*\* | In | {{text/xml}} |
| CamelHttpBaseUri \\
(2.0-m3 and before: {{CamelCxfBeanRequestBasePath}}) | The value of this header will be set in the CXF message as the {{Message.BASE_PATH}} property.  It is needed by CXF JAX-RS processing.  Basically, it is the scheme, host and port portion of the request URI. | {{String}} | Yes | The Endpoint URI of the source endpoint in the Camel exchange | In | [http://localhost:9000] |
| {{CamelHttpPath}} (before 2.0-m2: {{CamelCxfBeanRequestPat{}}}h) | Request URI's path | {{String}} | Yes | None | In | {{consumer/123}} |
| {{CamelHttpMethod}} (before 2.0-m2: {{CamelCxfBeanVerb}}) | RESTful request verb | {{String}} | Yes | None | In | {{GET}}, {{PUT}}, {{POST}}, {{DELETE}} |
| {{CamelHttpResponseCode}} | HTTP response code | {{Integer}} | No \\ | None | Out \\ | 200 \\ |
{div}
Note

Currently, the CXF Bean component has (only) been tested with the Jetty HTTP component it can understand component. It understands headers from Jetty HTTP component without requiring conversion.

...

This sample shows how to create a route that starts a an embedded Jetty HTTP server. The route sends requests to a CXF Bean and invokes a JAXRS JAX-RS annotated service.

First, create a route as follows. : The from endpoint is a Jetty HTTP endpoint that is listening on port 9000. Notice that the matchOnUriPrefix option must be set to true because the RESTful request URI will not exactly match the endpoint's URI http:­//localhost:9000 exactly.

Wiki Markup
{snippet:id=routeDefinition|lang=xml|url=camel/trunk/components/camel-cxf/src/test/resources/org/apache/camel/component/cxf/cxfbean/CxfBeanTest-context.xml}

...