CXF Bean — allows other Apache CXF endpoints to send exchanges and invoke Web service bean objects
The CXF Bean component allows other Apache Camel endpoints to send exchanges and invoke JAX-WS or JAXRS annotated service beans.
![]() | Note |
---|---|
The CXF Bean component works similarly to the Bean component. |
The URI format for a CXF Bean endpoint is:
cxfbean:serviceBeanRef
[?options
]
![]() | Note |
---|---|
If |
Maven users will need to add a dependency on camel-cxf
to their poms as
shown in Example 2, “Apache CXF dependency”.
Example 2. Apache CXF dependency
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-cxf</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
If you want to learn about Apache CXF dependencies, see the WHICH-JARS text file.
Table 3, “CXF Bean options” lists the options for a CXF Bean endpoint.
Table 3. CXF Bean options
Name | Default Value | Description |
---|---|---|
cxfBeanBinding | Specifies a CXF bean binding using the # notation. The
referenced object must be an instance of
org.apache.camel.component.cxf.cxfbean.CxfBeanBinding . | |
bus | Specifies a reference to a bus object in the registry using the
# notation. The referenced bus is used in place of the default
bus. | |
headerFilterStrategy | Specifies a reference to an instance of
org.apache.camel.spi.HeaderFilterStrategy in the
registry using the # notation. The referenced instance is used in
place of the default header filter strategy. | |
setDefaultBus | false | Specifies whether to use the default Apache CXF bus for this endpoint. |
populateFromClass | true | Specifies if the wsdlLocation annotation on the POJO is ignored. |
providers | Sets the providers for a CXFRS endpoint. |
Table 4, “CXF Bean headers” lists the headers used by a CXF Bean endpoint.
Table 4. CXF Bean headers
Name | Required | Type | Default Value | In/Out | Description |
---|---|---|---|---|---|
CamelHttpCharacterEncoding | No | String | In | Specifies the character encoding of the message. | |
Content-Type | No | String | \**/*\* | In | Specifies the content type of the message. |
CamelHttpBaseUri | Yes | String | The Endpoint URI of the source endpoint in the Camel exchange | In | Specifies the scheme, host and port portion of the request URI. The value of this header will be set in the CXF message as the Message.BASE_PATH property. It is needed by Apache CXF JAX-RS processing. |
CamelHttpPath | Yes | String | In | Specifies the request URI's path. | |
CamelHttpMethod | Yes | String | In | Specifies the RESTful request verb. | |
CamelHttpResponseCode | No | Integer | Out | Specifies the HTTP response code. |