Chapter 38. Payload-Based Route
38.1. Processing Messages in PAYLOAD Format
org.w3c.dom.Nodetype). One of the advantages of the PAYLOAD format is that no JAX-WS and JAXB stub code is required, which allows your application to be dynamic, potentially handling many different WSDL interfaces.
Camel CXF component
cxf:cxfEndpointXML 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:endpointXML element and are implemented by the Apache CXF project.
PAYLOAD data format
dataFormat=PAYLOADoption on a Camel CXF endpoint URI and it has the following characteristics:
- Enables you to access the message body as a DOM object (XML payload).
- No JAX-WS or JAXB stub code required.
- The SOAP body is marshalled as follows:
- The message body is effectively an XML payload of
org.w3c.dom.Nodetype (wrapped in a
- The type of the message body is
- The SOAP headers are converted into headers in the exchange's In message, of
Implementing and building a PAYLOAD route
- Instantiate the Camel CXF endpoint in Spring, using the
- Implement the route in XML, where you can use the content-based router to sort requests by operation name.
- For each operation, define a processor bean to process the request.
- Define velocity templates for generating the reponse messages.
Sample PAYLOAD route
CustomerServiceWeb service using the PAYLOAD data format. 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.
Figure 38.1. Sample PAYLOAD Route