[AIX Solaris HP-UX Linux Windows][z/OS]

Interoperating between SCA OASIS and OSOA composites

Service Component Architecture (SCA) applications are based on either the Open SOA Collaboration (OSOA) Version 1.0 SCA specifications or the OASIS SCA Version 1.1 specifications. You cannot mix OSOA and OASIS SCA artifacts, such as .composite files or sca-contribution.xml files, within the same asset. However, you can wire OASIS and OSOA SCA components together when both SCA composites are running in a single product cell.

Before you begin

For information about the differences between OSOA and OASIS specifications and about the differences between OSOA and OASIS in SCA applications, see the SCA overview topic.

About this task

This topic describes how you might wire OSOA and OASIS components together so that the components, although in separate SCA applications, can interoperate while both applications are running in the same product cell. The procedure provides a simple example that shows how to wire an OASIS component reference to an OSOA component service.

When wiring components for interoperation between OSOA and OASIS in SCA applications, consider the following restrictions:

Procedure

  1. Create an OSOA SCA application.
    1. Define an OSOA composite with a single component for the application.
      <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="InteropOSOARemote">
         <component name="HelloWorldService">
            <implementation.java class="interop.osoa.HelloWorldServiceImpl"/>
            <service name="HelloWorld"/>
         </component>
      </composite>
    2. Create a service interface that has a Java interface marked as remotable. The @Remotable annotation comes from the OSOA annotations package.
      package interop.osoa;
      
      import org.osoa.sca.annotations.Remotable;
      
      @Remotable
      public interface HelloWorld {
         public String sayHello(String text);
      }
    3. Create a service implementation.

      For this example, the service implementation adds the string "Hello " to the start of the text that it is sent, and then returns the modified text:

      package interop.osoa;
      
      public class HelloWorldServiceImpl implements HelloWorld {
         public String sayHello(String text) {
            return "Hello " + text;
         }
      }
  2. Create an OASIS SCA application and wire a component reference to the service that is defined in the OSOA application.
    1. Define an OASIS composite with a single component and with a reference to the service in the OSOA application.
      <composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" name="InteropOASIS">
         <component name="HelloWorldClient">
            <implementation.java class="interop.oasis.HelloWorldClientImpl"/>
            <service name="HelloWorld"/>
            <reference name="helloWorldOSOA" target="HelloWorldService"/>
         </component>
      </composite>
    2. Create a reference interface that has a Java interface marked as remotable.

      The reference interface is compatible with the HelloWorld service interface that is defined in the OSOA application but it is a different Java interface. The reference interface is in a different Java package; the @Remotable annotation comes from the OASIS annotations package.

      package interop.oasis;
      
      import org.oasisopen.sca.annotation.Remotable;
      
      @Remotable
      public interface HelloWorld {
         public String sayHello(String text);
      }
    3. Create a service implementation that implements the HelloWorld interface and uses a reference to the OSOA version of the component.

      For this example, the reference determines the text to return to the caller.

      package interop.oasis;
      
      import org.oasisopen.sca.annotation.Reference;
      
      public class HelloWorldClientImpl implements HelloWorld {
      
         @Reference
         protected HelloWorld helloWorldOSOA;
      
         public String sayHello(String text) {
            return helloWorldOSOA.sayHello(text);
         }
      }
  3. Deploy the SCA applications into the same, or separate, business-level applications in the same cell.

    For OSOA, an sca-contribution.xml file is not required if there is only one default.composite file in the Java archive (JAR). An sca-contribution.xml file can reside in the META-INF/ directory or in a subdirectory.

    For OASIS, an sca-contribution.xml file is required and must reside in the META-INF/ directory, and not in a subdirectory.

What to do next

To test the applications, you can call the HelloWorld service of the OASIS component (the HelloWorldClient component in step 2) and have the service return the string that it retrieves from the OSOA component (the HelloWorldService component in step 1).

Task topic    

Terms and conditions for information centers | Feedback

Last updated: April 20, 2014 08:46 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-nd-mp&topic=tsca_interop_osoa_oasis
File name: tsca_interop_osoa_oasis.html