Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
CxfExchange exchange = (CxfExchange)template.send(getJaxwsEndpointUri(), new Processor() {
            public void process(final Exchange exchange) {
                final List<String> params = new ArrayList<String>();
                params.add(TEST_MESSAGE);
                // Set the request context to the inMessage
                Map<String, Object> requestContext = new HashMap<String, Object>();
                requestContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, JAXWS_SERVER_ADDRESS);
                exchange.getIn().setBody(params);
                exchange.getIn().setHeader(Client.REQUEST_CONTEXT , requestContext);
                exchange.getIn().setHeader(CxfConstants.OPERATION_NAME, GREET_ME_OPERATION);
            }
        });
        org.apache.camel.Message out = exchange.getOut();
        // The output is an object array, the first element of the array is the return value
        Object[] output = out.getBody(Object[].class);
        LOG.info("Received output text: " + output[0]);
        // Get the response context form outMessage
        Map<String, Object> responseContext = CastUtils.cast((Map)out.getHeader(Client.RESPONSE_CONTEXT));
        assertNotNull(responseContext);
        assertEquals("Get the wrong wsdl opertion name", "{http://apache.org/hello_world_soap_http}greetMe", responseContext.get("javax.xml.ws.wsdl.operation").toString());

CXF Bean Component (2.0 or later)

The cxfbean: component allows other Camel endpoint to send exchange and invoke web service bean objects. (Currently, it only supports JAXRS annotated service bean.)

Note: CxfBeanEndpoint is a ProcessorEndpoint so it has no Consumers. It works similar to a Bean component.

URI format

Code Block

cxfbean:serviceBeanRef

Where serviceBeanRef is a registry key to looks service bean object. If serviceBeanRef references to a List, elements of the List are the service bean objects accepted by the endpoint.

Options

Name

Description

Example

Required?

default value

cxfBeanBinding

CXF bean binding specified by the "#" notation. The referenced object must be an instance of org.apache.camel.component.cxf.cxfbean.CxfBeanBinding.

cxfBinding=#bindingName

No

An instance of org.apache.camel.component.cxf.cxfbean.DefaultCxfBeanBinding

bus

CXF bus reference specified by the "#" notation. The referenced object must be an instance of org.apache.cxf.Bus.

bus=#busName

No

Default bus created by CXF Bus Factory

headerFilterStrategy

Header filter strategy specified by the # notation. The referenced object must be an instance of org.apache.camel.spi.HeaderFilterStrategy.

headerFilterStrategy=#strategyName

No

An instance of org.apache.camel.component.cxf.CxfHeaderFilterStrategy

setDefaultBus

Will set the default bus when CXF endpoint create a bus by itself

true, false

No

false

Include Page
CAMEL:Endpoint See Also
CAMEL:Endpoint See Also