Introduction

This getting started guide shows how to install Jbi4Corba and a sample service assembly in ServiceMix. This component has been tested with servicemix-3.1.1-incubating.

Integration Scenario

Installing tools.jar

Installing Jbi4Corba Binding Component

Creating a service assembly

Deploying a service assembly

Integration Scenario

A binding component using Jbi4Corba exposes on the internal BUS an external service provided by a CORBA servant. To locate the servant, the Jbi4Corba component must use a CORBA name server (or other localization mechanism).

Thus the integration scenario is shown in the following figure:

Integration Scenario.

Installing tools.jar

Jbi4Corba needs the jdk's tools.jar. You can put this jar file in the <SERVICEMIX_HOME>/lib/optional.

Installing Jbi4Corba Binding Component

To run jbi4corba it's necessary both a shared library and the component. The shared library contains jacorb's orb and it's named jacorb-library.zip. Download Jbi4Corba and copy them into <SERVICEMIX_HOME>/install.

Creating a service assembly

A service assembly is a deployable item that configure one or more endpoint inside a JBI ESB. We are going set up a configuration that take a Corba service and expose it a SOAP/HTTP Webservice. The configuration is shown in the following figure:

A Corba service exposed as a SOAP/HTTP Webservice.

The Jbi4Corba component is used to create an internal (i.e. visible inside the ESB) endpoint. This internal endpoint is then used to create an external endpoint with the servicemix-http Binding Component. The http component will proxy the incoming externall calls to the internal endpoint exploiting the JBI routing mechanisms.

A Service Assembly (SA) is a zip file containing one or more Service Unit (SU) file, each Service Unit defining one or more endpoint. We need two Service Unit (SU):

  • JBI4CorbaSU containing the definition for the Jbi4Corba endpoint.
  • HttpSU containing the definition for the http endpoint.

Jbi4Corba service unit

A Jbi4Corba service unit has the following layout:

+- <WSDL_NAME>.wsdl
+- META-INF/
      +- jbi.xml

where:

  • WSDL_NAME.wsdl contains the informations for defining the endpoint. Pending the command line tool to create the WSDL use The Netbeans Plugin Guide to create a Jbi4Corba service unit.
  • jbi.xml is a JBI mandatory file.

Zip all the files in the specified layout and name the archive JBI4CorbaSU.zip.

Http service unit

A http service unit has the following layout:

+- xbean.xml
+- META-INF/
      +- jbi.xml

where:

  • xbean.xml contains the informations for defining the endpoint.
  • jbi.xml is a JBI mandatory file.

the xbean.xml has the following format:

<?xml version="1.0"?>
<beans xmlns:http="http://servicemix.apache.org/http/1.0"
  xmlns:corba_urn="<SERVICE_NAMESPACE>">

  <http:endpoint 
    service="corba_urn:<SERVICE_NAME>"
    endpoint="<SERVICE_NAME>CorbaPort" 
    interfaceName="corba_urn:<SERVICE_NAME>"
    role="consumer"
    locationURI="http://localhost:8192/Service/<SERVICE_NAME>"
    defaultMep="http://www.w3.org/2004/08/wsdl/in-out" 
    soap="true" />
</beans>

where:

  • SERVICE_NAMESPACE is the service namespace as defined in the JBI4Corba service unit.
  • SERVICE_NAME is the service name as defined in the JBI4CorbaSU service unit.

Zip all the files in the specified layout and name the archive HttpSU.zip (the archive name is not important)

The service assembly

The service assembly is unit of deployable configuration in JBI, in our example it has the following layout:

+- JBI4CorbaSU.zip
+- HttpSU.zip
+- META-INF/
      +- jbi.xml

where:

  • JBI4CorbaSU.zip and HttpSU.zip are the previously created service units.
  • jbi.xml is the service assembly deployment descriptor.

The jbi.xml has the following format as described in the JBI Specification:

<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
  <service-assembly>
    <identification>
      <name><SA_NAME></name>
      <description><SA_DESCRIPTION></description>
    </identification>
    <service-unit>
      <identification>
        <name><SU1_NAME></name>
        <description><SU1_DESCRIPTION></description>
      </identification>
      <target>
        <artifacts-zip>JBI4CorbaSU.zip</artifacts-zip>
        <component-name>jbi4corba</component-name>
      </target>
    </service-unit>
    <service-unit>
      <identification>
        <name><SU2_NAME></name>
        <description><SU2_DESCRIPTION></description>
      </identification>
      <target>
            <artifacts-zip>HttpSU.zip</artifacts-zip>
        <component-name>servicemix-http</component-name>
      </target>
    </service-unit>
  </service-assembly>
</jbi>    

where:

  • SA_NAME is the name of the service assembly for documentation purposes.
  • SA_DESCRIPTION is the service assembly desription for documentation purposes.
  • SU1_NAME and SU2_NAME are the service units names for documentation purposes.
  • SU1_DESCRIPTION and SU2_DESCRIPTION are the service units description for documentation purposes.

Notice that the BC filenames (JBI4CorbaSU.zip and HttpSU.zip) are specified with the respective component (jbi4corba and servicemix-http). Zip all the files in the specified layout and name the archive HttpToCorbaSA.zip (the archive name is not important).

ServiceMix provides a maven2 plugin to automate the process of creation and deploy of JBI artifacts.

Deploying a service assembly

Copy the created service assembly in <SERVICEMIX_HOME>/deploy.