Role: Provider

Introduction

The jbi4corba component may act as a provider.

In this scenario the component uses an IDL file to dynamically create the classes for a CORBA client. When the endpoint is deployed, it looks for the CORBA servant using one of the supported lookup mechanism specified in the 'imolacorba:address' element defined in the WSDL.

When the component is configured properly you can use it inside the ESB to integrate with others services. For example, you can use an HTTP component to expose your client CORBA for using it with other technologies.

Notes

  1. service name

    The service unit uses the CORBA name service to looking for the CORBA servant, so you should active it before starting the SU.

  2. start order

    First of all you should start the Name Service. The component in provider mode must be started after the CORBA servant has registered itself in the Name Service to avoid problems caused by different IOR used from the client and the servant.

  3. supported idl types and construcs

    Jbi4Corba supports the main IDL types, see details on supported types.

How to deploy the component

In this scenario we create a standard WSDL that represents our service with our types and operations as usual, but before use it inside the bus we must add some extra information using the extensibility element in the WSDL.

The first step is adding the namespace of the extensibility element in the wsdl description

  <wsdl:definitions ...

    xmlns:imolacorba="uri://schemas.imola.it/jbi/wsdl-extensions/corba/"

The second step involves the binding section of the wsdl where we indicate the IDL file used by the component.

  <wsdl:binding name="EchoWSDLJBIPortBinding" type="tns:EchoWSDLPortType">
    <imolacorba:binding>
      <imolacorba:idl>
        <IDL_FILE>
      </imolacorba:idl>
    </imolacorba:binding>
  </wsdl:binding>

The component needs the IDL file to construct a specific CORBA client. This file in the wsdl way is specified inside the wsdl within the 'imolacorba:idl' element.

For example

  <imolacorba:idl>      
    module it{
      module imolinfo{
        interface Echo {
          string echo(in string msg);
        };
      };
    };
  </imolacorba:idl>

The last step is adding, in the wsdl:port, the element that instructs the component about the name of the CORBA servant and the name of the CORBA service name and where we indicate all the information the other properties used by the component. For example:

  <wsdl:service name="EchoWSDL">
    <wsdl:port binding="tns:EchoWSDLJBIPortBinding" name="EchoWSDLJBIPort">
        <imolacorba:address name="<CORBA_SERVANT>" localizationType="<LOCALIZATION_TYPE>">      
        <imolacorba:orb>
          <imolacorba:property name="org.omg.CORBA.ORBInitialPort" value="<SERVICE_NAME_PORT>"/>
          <imolacorba:property name="org.omg.CORBA.ORBInitialHost" value="<SERVICE_NAME_HOST>"/>
        </imolacorba:orb>
      </imolacorba:address>
    </wsdl:port>
  </wsdl:service>

The localization type is the way used to localize the CORBA servant.

The localization mechanisms should be used with the 'name' property to specify where to localize the CORBA service.

  <wsdl:service name="ServantCorbalocWsdl">
    <wsdl:port binding="tns:ServantCorbalocWsdlJBIPortBinding" 
               name="ServantCorbalocWsdlJBIPort">
      <imolacorba:address localizationType="corbaloc" 
                          name="corbaloc:iiop:1.2@127.0.0.1:1061/ServantCorbalocWsdl" />                
    </wsdl:port>
  </wsdl:service>
Name Optional Default Description
localizationType no It is the localization mechanism.
At this moment the component support 4 localization mechanisms:
NameService, corbaloc, corbaname and IOR (saved on a file).

Moreover, we have indicated the properties used within the ORB using the 'imolacorba:orb' element. Those properties will be used by the CORBA instance of this service unit. You can configure any orb property that you need using the name value couple. Remember that the properties are orb's specific.

The following example shows how to locate the CORBA name service using the jdk orb. In fact, the org.omg.CORBA.ORBInitialPort and org.omg.CORBA.ORBInitialHost is where the service is listening and where the provider looking for a specific CORBA servant.

For example

  <imolacorba:orb>
    <imolacorba:property name="org.omg.CORBA.ORBInitialPort" value="1050"/>
    <imolacorba:property name="org.omg.CORBA.ORBInitialHost" value="localhost"/>
  </imolacorba:orb>