...
Remarks :
(1) - The CXF component will be used by Camel to receive incoming web services calls
(2) - A header is added to the message with the property origin
setted to webservice
(3) - The content of the SOAP envelop is extract and the XML messages is mapped to the InputReportIncident
class
(4) - A message contaning the header, InputReportIncident object is send the bean "Webservice" where the object will be transformed into an Incident
object
(5) - The message is placed into a queue which is a inOnly so no OUT message will be send back to the bean webservice
(6) - A transform process is added to send back to the web services the reply. Using camel:method, we can define which method of the class to use
From queue to DB
The last route will read messages of the queue and send them to the bean IncidentSaver
to save the incidents in the database
Code Block | ||||
---|---|---|---|---|
| ||||
... <camel:route> <camel:from uri="queuingservice:queue:in" /> <camel:to uri="bean:incidentSaver?method=process" /> </camel:route> </camelContext> |
Remarks :
(1) -
(2) -
(3) -
(4) -
(5) -
Add instructions to generate MANIFEST.MF file
Now that the reportincident.routing project is ready, we will modify the pom.xml file to add required instructions to generate the jar and MANIFEST.MF file of the bundle Once that you have finished to configure camel, created your classes, the pom.xml file must be modified :
Code Block | ||||
---|---|---|---|---|
| ||||
... <instructions> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <Import-Package> (1) META-INF.cxf, META-INF.cxf.osgi, META-INF.wsdl, org.apache.commons.logging, org.apache.camel, org.apache.camel.component, org.apache.camel.component.cxf, org.apache.camel.component.cxf.converter, org.apache.camel.component.jms, org.apache.camel.converter, org.apache.camel.converter.jaxp, org.apache.camel.converter.stream, org.apache.camel.dataformat.bindy, org.apache.camel.dataformat.bindy.csv, org.apache.camel.example.reportincident, org.apache.camel.example.reportincident.model, org.apache.camel.example.reportincident.service, org.apache.camel.processor, org.apache.activemq.camel.component;${activemq.osgi.version}, org.apache.activemq.camel.converter;${activemq.osgi.version}, org.apache.activemq.pool, org.apache.cxf, org.apache.cxf.binding, org.apache.cxf.binding.corba, org.apache.cxf.binding.soap, org.apache.cxf.binding.soap.spring, org.apache.cxf.bus, org.apache.cxf.bus.resource, org.apache.cxf.bus.spring, org.apache.cxf.buslifecycle, org.apache.cxf.catalog, org.apache.cxf.configuration, org.apache.cxf.configuration.spring, org.apache.cxf.endpoint, org.apache.cxf.headers, org.apache.cxf.management, org.apache.cxf.management.jmx, org.apache.cxf.phase, org.apache.cxf.resource, org.apache.cxf.transport, org.apache.cxf.transport.http, org.apache.cxf.transport.http.policy, org.apache.cxf.transport.http_jetty, org.apache.cxf.transport.jms, org.apache.cxf.transports.http, org.apache.cxf.workqueue, org.apache.cxf.wsdl, org.apache.cxf.wsdl11, org.apache.servicemix.cxf.transport.http_osgi, org.springframework.beans.factory.config, * </Import-Package> <Private-Package>org.apache.camel.example.reportincident.internal</Private-Package> (2) </instructions> ... |
...