Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Swordfish Documentation: CXF Integration"

Line 1: Line 1:
 
Swordfish is built on top of the Servicemix 4 NMR and it leverages its CXF integration capabilities.
 
Swordfish is built on top of the Servicemix 4 NMR and it leverages its CXF integration capabilities.
  
'''CXF endpoint deployment'''
+
<BR>'''CXF endpoint deployment'''<BR>
 
[http://servicemix.apache.org/SMX4/cxf-examples.html http://servicemix.apache.org/SMX4/cxf-examples.html]
 
[http://servicemix.apache.org/SMX4/cxf-examples.html http://servicemix.apache.org/SMX4/cxf-examples.html]
  
Line 31: Line 31:
  
 
The Swordfish team has created the sample that deploys the CXF endpoint [https://dev.eclipse.org/svnroot/rt/org.eclipse.swordfish/trunk/org.eclipse.swordfish.samples/org.eclipse.swordfish.samples.cxfendpoint org.eclipse.swordfish.samples.cxfendpoint]
 
The Swordfish team has created the sample that deploys the CXF endpoint [https://dev.eclipse.org/svnroot/rt/org.eclipse.swordfish/trunk/org.eclipse.swordfish.samples/org.eclipse.swordfish.samples.cxfendpoint org.eclipse.swordfish.samples.cxfendpoint]
'''Http consumer endpoint deployment'''
+
<BR>'''Http consumer endpoint deployment'''<BR>
 
The CXF endpoint may be exposed via the ServiceMix http binding component
 
The CXF endpoint may be exposed via the ServiceMix http binding component
  

Revision as of 08:36, 10 March 2009

Swordfish is built on top of the Servicemix 4 NMR and it leverages its CXF integration capabilities.


CXF endpoint deployment
http://servicemix.apache.org/SMX4/cxf-examples.html

To deploy the CXF endpoint into the NMR, the bundle that contains the following spring osgi application context should be started:

  <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:osgi="http://www.springframework.org/schema/osgi"
      xmlns:camel-osgi="http://activemq.apache.org/camel/schema/osgi"
      xmlns:http="http://servicemix.apache.org/http/1.0"
      xmlns:jaxws="http://cxf.apache.org/jaxws"
      xsi:schemaLocation="
      http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd
      http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
   <import resource="classpath:META-INF/cxf/cxf.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
   <import resource="classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml" />
   <jaxws:endpoint id="bookingService"
                       implementor="org.eclipse.swordfish.samples.cxf.BookingServiceImpl"
                       address="nmr:BookingService">
                       <jaxws:inInterceptors>
                       <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
                       </jaxws:inInterceptors>
   </jaxws:endpoint>
 </beans>

The entry address="nmr:BookingService" specifies that endpoint should be pluged into the nmr and it should be deployed along with the property SERVICE_NAME=BookingService.

The Swordfish team has created the sample that deploys the CXF endpoint org.eclipse.swordfish.samples.cxfendpoint
Http consumer endpoint deployment
The CXF endpoint may be exposed via the ServiceMix http binding component

1. Make sure that the Swordfish distribution contains the osgi packaged http binding component(servicemix-http bundle symbolic name) 2. Add the bundle that deploys the http consumer endpoint without the jbi packaging http://servicemix.apache.org/SMX4NMR/3-deploying-jbi-components-without-the-jbi-packaging.html The bundle should contain the Spring OSGI application context with such entry:

    <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:http="http://servicemix.apache.org/http/1.0"       
      xmlns:osgi="http://www.springframework.org/schema/osgi"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="
       http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/osgi
       http://www.springframework.org/schema/osgi/spring-osgi.xsd
       http://servicemix.apache.org/http/1.0
       http://servicemix.apache.org/http/1.0/servicemix-http.xsd">  
       <bean class="org.apache.servicemix.common.osgi.EndpointExporter" />  
     <http:endpoint                  
                endpoint="httpConsumerEndpoint"                 
                service="httpConsumerEndpoint"
                targetService="{http://cxf.samples.swordfish.eclipse.org/}BookingService"
                soap="true"
                role="consumer"                  
                locationURI="http://0.0.0.0:8192/cxfsample/"
                defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
    </beans>

You can explore the corresponding Swordfish sample here

Back to the top