Skip to main content Skip to complementary content

Use a Camel route

Procedure

  1. From a command-line window, navigate to this folder and type mvn clean install eclipse:eclipse. This will create an Eclipse project out of this sample that can be imported into Eclipse.
  2. From the Eclipse menu, select File : Import..., and from the Import popup, choose Existing Projects into Workspace (see below). Click Next.

    Example

  3. For the root directory navigate to the examples/apache/camel/camel-example-cxf-osgi folder and select the camel-example-cxf-osgi example from the Projects list.
  4. Click Finish, you will see it in the Eclipse Package Explorer. (Optional) You can open 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.)
  5. As this example runs in the Talend Runtime Container, the container needs to be started prior to running it. Navigate to the <TalendRuntimePath>/container/bin folder 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
  6. Open a web browser and make sure you can view the above web service WSDL at http://localhost:8040/services/camel-example-cxf-osgi/webservices/incident?wsdl before continuing.
  7. A SOAP call needs to be made using SoapUI. Make sure you have 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:

    Example

  8. Create a new project called camel-example-cxf-osgi. Point to the following url: http://localhost:8181/cxf/camel-example-cxf-osgi/webservices/incident?wsdl
  9. In the soapUI Navigator view, open 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>bobsmith@email.com</email> <phone>123-456-7890</phone> </ns2:inputReportIncident> </soap:Body> </soap:Envelope>
  10. Press the green arrow in the soapUI navigator to make the SOAP call.
    In the Navigator View, you can see the SOAP response stating that the incident report was accepted. Additionally, if you check the new target/inbox folder under the camel-example-cxf-osgi sample directory, you can see that a file was created storing the SOAP request, completing the Camel route.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!