LibraryToggle FramesPrintFeedback

The Camel CXF component is an Apache CXF component that integrates Web services with routes. You can use it either to instantiate consumer endpoints (at the start of a route), which behave like Web service instances, or to instantiate producer endpoints (at any other points in the route), which behave like WS clients.

[Note]Note

Came CXF endpoints—which are instantiated using the cxf:cxfEndpoint XML element and are implemented by the Apache Camel project—are not to be confused with the Apache CXF JAX-WS endpoints—which are instantiated using the jaxws:endpoint XML element and are implemented by the Apache CXF project.

The provider-based approach is a variant of the PAYLOAD data format, which is enabled as follows:

The provider-based approach has the following characteristics:

  • Enables you to access the message body as a streamed XML type—for example, javax.xml.transform.sax.SAXSource.

  • No JAX-WS or JAX-B stub code required.

  • The SOAP body is marshalled into a stream-based SAXSource type.

  • The SOAP headers are converted into headers in the exchange's In message, of org.apache.cxf.binding.soap.SoapHeader type.

Figure 7.1 shows an outline of the route that is used to process the operations of the CustomerService Web service using the provider-based approach. After sorting the request messages by operation name, an operation-specific processor bean reads the incoming request parameters. Finally, the response messages are generated using Velocity templates.


Comments powered by Disqus