[CONF] Apache Camel CXF Example OSGi
willem jiang edited the page: CXF Example OSGi ... You will need to compile the example first: Code Block language text mvn install Remarks: During the compilation phase, a unit test will be performed which simulates the client calling the web service exposed by our camel/cxf route. In Eclipse, I have used the following option when starting the junit test case. This option tells CXF that it must use log4j : -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger ... 1) launch the server Code Block language text
[CONF] Apache Camel CXF Example OSGi Blueprint
willem jiang edited the page: CXF Example OSGi Blueprint ... You will need to compile this example first: Code Block language text mvn install To run the example on Apache ServiceMix 4.x or Apache Karaf 2.x 1) launch the server Code Block language text karaf.bat Note for Karaf 2.2.x: a) edit the etc/jre.properties file to add the following packages to be exported
[CONF] Apache Camel CXF Example OSGi Blueprint
CXF Example OSGi Blueprint Page edited by Glen Mazza Comment: Sync'ing online doc to recently updated README file. Changes (18) ... {info} A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. Its not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start its own Jetty instance. Another possibility you get is, that all your provided services can share the same port. A simple example which receives web service calls (via a CXF consumer, using bean binding) and writes these requests into the file system. Its not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All Camel bundles using a Camel CXF consumer can use this HTTP service without needing to start individual Jetty instances. Another advantage is that all provided services can now share the same port. This example is located in the {{examples/camel-example-cxf-blueprint}} directory of the Camel distribution. ... {code} To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 1) launch the server ... {code} For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported Note for Karaf 2.2.x: a) edit the etc/jre.properties file to add the following packages to be exported jre-1.6=, \ {code} jre-1.6=, com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.dom, com.sun.org.apache.xerces.internal.jaxp, \ com.sun.org.apache.xerces.internal.jaxp, \ {code} b) from the same file comment out the following exports already provided by the bundles that will be imported next: javax.xml.bind*, javax.jws*, javax.xml.soap*, javax.xml.ws*,javax.activation, javax.annotation, javax.xml.stream*. 2) Add features required {code} features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features features:install war features:install war cxf features:install cxf camel-jaxb features:install camel-cxf camel-blueprint features:install camel-blueprint camel-cxf {code} Note: Apache Camel 2.9.0 is being used above, but you should of course change theversion number to the exact version of Camel being used. 3) Deploy the example bundle {code} ... {code} 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. 4) Verify that your service is available using the following url in the browser. We assume youre using Karafs default PAX Web configuration which uses port 8181 for http. If you would like to use another port or https, change the configuration in $\{KARAF_HOME\}/etc/org.ops4j.pax.web.cfg. The immediate extension after the hostname and port (cxf inthe below URL) is configured via the org.apache.cxf.osgi.cfg file (Please see http://team.ops4j.org/wiki//display/paxweb/Pax+Web for more information on PAX Web). {code} http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl ... 5) Start SOAPUI Create a new project called camel-example-cxf-osgi Point to the following url : http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl Open the request 1 (under camel-example-blueprint-osgi camel-example-cxf-blueprint -- ReportIncidentBinding -- ReportIncident) and copy/paste the a SOAP message generated by the unit test, for example: ex : -- and the message formatted that you copy in SOAPUI {code:xml} ?xml version=1.0 encoding=UTF-8? soap:Envelope
[CONF] Apache Camel CXF Example OSGi
CXF Example OSGi Page edited by Glen Mazza Comment: Moved over updated information from CAMEL-4613. Changes (25) ... {info} A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. Its not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start its own Jetty instance. Another possibility you get is, that all your provided services can share the same port. A simple example which receives web service calls (via a CXF consumer, using bean binding) and writes these requests to the file system. Its not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All Camel bundles using a Camel CXF consumer can use this HTTP service without needing to start individual Jetty instances. Another advantage is that all provided services can now share the same port. This example is located in the {{examples/camel-example-cxf-osgi}} directory of the Camel distribution. There is a {{README.txt}} file with instructions how to run it. You will need to compile this the example first: {code} mvn install ... Remarks: - During the compilation phase, a unit test will be performed, this unit test performed which simulates the communication between a client calling the web service exposed by our camel/cxf route. - In Eclipse, I have used the following option when starting the junit test case. This option tells CXF that it must use log4j : -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 2.2.x 1) launch the server ... {code} For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported Note for Karaf 2.2.x:a) edit the etc/jre.properties file to add the following packages to be exported {code} jre-1.6=, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.dom, com.sun.org.apache.xerces.internal.jaxp, \ com.sun.org.apache.xerces.internal.jaxp, \ {code} b) from the same file comment out the following exports already provided by the bundles that will be imported next: javax.xml.bind*, javax.jws*, javax.xml.soap*, javax.xml.ws*,javax.activation, javax.annotation, javax.xml.stream*. 2) Add features required {code} features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features mvn:org.apache.camel.karaf/apache-camel/2.9.0/xml/features features:install war features:install cxf features:install camel-spring features:install camel-jaxb features:install camel-cxf {code} Note: Apache Camel 2.9.0 is being used above, but you should of course change the version number to the exact version of Camel being used. 3) Deploy the example bundle {code} osgi:install -s mvn:org.apache.camel/camel-example-cxf-osgi/2.9.0 {code} 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use 4) Verify that your service is available using the following url in the browser.We assume assuming the OOTB Karaf defaults you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. $\{KARAF_HOME\}/etc/org.ops4j.pax.web.cfg. The immediate extension after the hostname and port (cxf in the below URL) is configured via the org.apache.cxf.osgi.cfg file (Please seehttp://team.ops4j.org/wiki//display/paxweb/Pax+Web for more information on PAX Web). {code}
[CONF] Apache Camel CXF Example OSGi
CXF Example OSGi Page edited by Claus Ibsen Changes (3) ... *Available as of Camel 2.8* {info:title=Spring-DM vs. OSGi Blueprint} This example uses Spring DM for OSGi. There is another [CXF Example OSGi Blueprint] that uses Blueprint. {info} The example is in the {{examples/camel-example-cxf-osgi}} directory. A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. Its not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start its own Jetty instance. Another possibility you get is, that all your provided services can share the same port. ... ex : -- and the message formatted that you copy in SOAPUI {code:xml} ?xml version=1.0 encoding=UTF-8? soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/ ... 6) Check the file system Check the folder target/inbox/ in your file system that a message has been arrived. h3. See Also - [CXF Example OSGi Blueprint] - [Examples] Full Content CXF Example OSGi Available as of Camel 2.8 Spring-DM vs. OSGi BlueprintThis example uses Spring DM for OSGi. There is another CXF Example OSGi Blueprint that uses Blueprint. The example is in the examples/camel-example-cxf-osgi directory. A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. It's not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start it's own Jetty instance. Another possibility you get is, that all your provided services can share the same port. This example is located in the examples/camel-example-cxf-osgi directory of the Camel distribution. There is a README.txt file with instructions how to run it. You will need to compile this example first: mvn install Remarks: During the compilation phase, a unit test will be performed, this unit test simulates the communication between a client calling the web service exposed by our camel/cxf route. In Eclipse, I have used the following option when starting the junit test case. This option tells CXF that it must use log4j : -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 1) launch the server karaf.bat For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported jre-1.6=, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.jaxp, \ 2) Add features required features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features features:install war features:install cxf features:install camel-cxf 3) Deploy the example bundle osgi:install -s mvn:org.apache.camel/camel-example-cxf-osgi 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. http://localhost:8181/cxf/camel-example-cxf-osgi/webservices/incident?wsdl 5) Start SOAPUI 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 Open the request 1 (under camel-example-cxf-osgi -- ReportIncidentBinding -- ReportIncident) and copy/paste the SOAP message generated by the unit test ex : -- and the message formatted that you copy in SOAPUI ?xml version="1.0" encoding="UTF-8"? soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header / soap:Body ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org" incidentId111/incidentId incidentDate2011-03-05/incidentDate givenNameChristian/givenName
[CONF] Apache Camel CXF Example OSGi Blueprint
CXF Example OSGi Blueprint Page added by Claus Ibsen CXF Example OSGi Blueprint Available as of Camel 2.8 Spring-DM vs. OSGi BlueprintThis example uses OSGi Blueprint for OSGi. There is another CXF Example OSGi that uses Spring-DM. A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. It's not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start it's own Jetty instance. Another possibility you get is, that all your provided services can share the same port. This example is located in the examples/camel-example-cxf-blueprint directory of the Camel distribution. There is a README.txt file with instructions how to run it. You will need to compile this example first: mvn install To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 1) launch the server karaf.bat For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported jre-1.6=, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.jaxp, \ 2) Add features required features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features features:install war features:install cxf features:install camel-cxf features:install camel-blueprint 3) Deploy the example bundle osgi:install -s mvn:org.apache.camel/camel-example-cxf-blueprint 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl 5) Start SOAPUI Create a new project called camel-example-cxf-osgi Point to the following url : http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl Open the request 1 (under camel-example-blueprint-osgi -- ReportIncidentBinding -- ReportIncident) and copy/paste the SOAP message generated by the unit test ex : -- and the message formatted that you copy in SOAPUI ?xml version="1.0" encoding="UTF-8"? soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header / soap:Body ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org" incidentId111/incidentId incidentDate2011-03-05/incidentDate givenNameChristian/givenName familyNameMueller/familyName summaryBla/summary detailsBla bla/details emailcmuel...@apache.org/email phone0049 69 1234567/phone /ns2:inputReportIncident /soap:Body /soap:Envelope 6) Check the file system Check the folder "target/inbox/" in your file system that a message has been arrived. See Also CXF Example OSGi Examples Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel CXF Example OSGi
CXF Example OSGi Page added by willem jiang CXF Example OSGi Available as of Camel 2.8 A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. It's not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start it's own Jetty instance. Another possibility you get is, that all your provided services can share the same port. This example is located in the examples/camel-example-cxf-osgi directory of the Camel distribution. There is a README.txt file with instructions how to run it. You will need to compile this example first: mvn install Remarks: During the compilation phase, a unit test will be performed, this unit test simulates the communication between a client calling the web service exposed by our camel/cxf route. In Eclipse, I have used the following option when starting the junit test case. This option tells CXF that it must use log4j : -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 1) launch the server karaf.bat For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported jre-1.6=, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.jaxp, \ 2) Add features required features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features features:install http features:install cxf features:install camel-cxf 3) Deploy the example bundle osgi:install -s mvn:org.apache.camel/camel-example-cxf-osgi 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. http://localhost:8181/cxf/camel-example-cxf-osgi/webservices/incident?wsdl 5) Start SOAPUI 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 Open the request 1 (under camel-example-cxf-osgi -- ReportIncidentBinding -- ReportIncident) and copy/paste the SOAP message generated by the unit test ex : -- and the message formatted that you copy in SOAPUI ?xml version="1.0" encoding="UTF-8"? soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header / soap:Body ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org" incidentId111/incidentId incidentDate2011-03-05/incidentDate givenNameChristian/givenName familyNameMueller/familyName summaryBla/summary detailsBla bla/details emailcmuel...@apache.org/email phone0049 69 1234567/phone /ns2:inputReportIncident /soap:Body /soap:Envelope 6) Check the file system Check the folder "target/inbox/" in your file system that a message has been arrived. Change Notification Preferences View Online | Add Comment
[CONF] Apache Camel CXF Example OSGi
CXF Example OSGi Page edited by Christian Mueller Changes (1) ... {code}features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features features:install http war features:install cxf features:install camel-cxf ... Full Content CXF Example OSGi Available as of Camel 2.8 A simple example which receives web service calls (via a CXF consumer, using bean binding) and write these requests into the file system. It's not a very useful use case, but the goal of this example is to show you how you can use the CXF consumer component in an OSGI environment with the OSGI HTTP service. If your target container is Apache Karaf or Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP service. All your Camel bundles using a Camel CXF consumer can use this HTTP service and do not have to start it's own Jetty instance. Another possibility you get is, that all your provided services can share the same port. This example is located in the examples/camel-example-cxf-osgi directory of the Camel distribution. There is a README.txt file with instructions how to run it. You will need to compile this example first: mvn install Remarks: During the compilation phase, a unit test will be performed, this unit test simulates the communication between a client calling the web service exposed by our camel/cxf route. In Eclipse, I have used the following option when starting the junit test case. This option tells CXF that it must use log4j : -Dorg.apache.cxf.Logger=org.apache.cxf.common.logging.Log4jLogger To run the example on Apache ServiceMix 4.x or Apache Karaf 1.x / 2.x 1) launch the server karaf.bat For Karaf 2.0 : edit the file jre.properties to add the following packages to be exported jre-1.6=, \ com.sun.org.apache.xerces.internal.dom, \ com.sun.org.apache.xerces.internal.jaxp, \ 2) Add features required features:addUrl mvn:org.apache.camel.karaf/apache-camel/2.8-SNAPSHOT/xml/features features:install war features:install cxf features:install camel-cxf 3) Deploy the example bundle osgi:install -s mvn:org.apache.camel/camel-example-cxf-osgi 4) Verify that your service is available using in the browser the following url. We assume you use the default PAX Web configuration which use the port 8181 for http. If you would like to use another port or https, change the configuration in KARAF_HOME/etc/org.ops4j.pax.web.cfg. Please see http://wiki.ops4j.org/display/paxweb/Pax+Web for more information. http://localhost:8181/cxf/camel-example-cxf-osgi/webservices/incident?wsdl 5) Start SOAPUI 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 Open the request 1 (under camel-example-cxf-osgi -- ReportIncidentBinding -- ReportIncident) and copy/paste the SOAP message generated by the unit test ex : -- and the message formatted that you copy in SOAPUI ?xml version="1.0" encoding="UTF-8"? soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:Header / soap:Body ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org" incidentId111/incidentId incidentDate2011-03-05/incidentDate givenNameChristian/givenName familyNameMueller/familyName summaryBla/summary detailsBla bla/details emailcmuel...@apache.org/email phone0049 69 1234567/phone /ns2:inputReportIncident /soap:Body /soap:Envelope 6) Check the file system Check the folder "target/inbox/" in your file system that a message has been arrived. Change Notification Preferences View Online | View Changes | Add Comment