To demonstrate the usage and deployment of a Camel route within Talend ESB using Eclipse, we'll use
camel-example-cxf-osgi example, located within the
folder of the Talend ESB distribution. Steps:
From a command-line windows, navigate to this folder and type mvn clean install eclipse:eclipse. This will create an Eclipse project out of this sample that we can import into Eclipse.
From Eclipse we can now import the project. From the Menu row, select File : Import..., and from the resulting [Import] popup, choose Existing Projects into Workspace (see illustration below). Select Next.
For the root directory navigate to the
examples/apache/camel/camel-example-cxf-osgifolder and select the
camel-example-cxf-osgiexample from the Projects list. Select Finish and you'll see it in the Eclipse Package Explorer. Here would be a good time to open up the project source files and look at the code (this example is explained on the Apache Camel site at http://camel.apache.org/cxf-example-osgi.html.)
As this example runs in the Talend Runtime container, we'll need to start the container prior to running this example. Navigate to the
<TalendRuntimePath>/container/binfolder and enter trun.bat or ./trun. Enter the following commands at the resulting console to install the example:
feature:repo-add mvn:org.apache.camel.karaf/apache-camel/2.10.2/xml/features feature:install war feature:install camel-spring feature:install camel-jaxb feature:install camel-cxf bundle:install -s mvn:org.apache.camel/camel-example-cxf-osgi/2.10.2
Open a web browser and make sure you can view the above web service WSDL at
We'll make a SOAP call using soapUI in this step. Make sure you've already installed soapUI in Eclipse as discussed in Development Environment Setup (standalone soapUI is also fine.) From Eclipse, select Menu Item Window | Show View | Other..., and select soapUI Navigator from the View list (see illustration below.)
Create a new project called camel-example-cxf-osgi. Point to the following url:
In the soapUI Navigator view, open the request 1 (under camel-example-cxf-osgi --> ReportIncidentBinding --> ReportIncident) and copy and paste the following SOAP Message:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header /> <soap:Body> <ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org"> <incidentId>111</incidentId> <incidentDate>2011-10-05</incidentDate> <givenName>Bob</givenName> <familyName>Smith</familyName> <summary>incident summary</summary> <details>incident summary details</details> <email>firstname.lastname@example.org</email> <phone>123-456-7890</phone> </ns2:inputReportIncident> </soap:Body> </soap:Envelope>
Press the green arrow in the soapUI navigator to make the SOAP call. Within the Navigator View you'll see the SOAP response stating that the incident report was accepted. Also, checking a new
target/inboxfolder under the
camel-example-cxf-osgisample directory you'll see a file was created storing the SOAP request, completing the Camel route.