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

Using the SCA default binding to find and locate SCA services (deprecated)

The product supports APIs that Service Component Architecture (SCA) and non-SCA clients can use to find and invoke SCA services over the SCA default binding.

About this task

A non-SCA client can use the OASIS SCAClientFactory API to obtain a service proxy for an OASIS SCA service in the same domain (product cell). An OASIS SCA client also can use this API as an alternative to wiring a reference in the composite file.

A non-SCA client can use the product CompositeContext API to obtain a service proxy for an OSOA SCA service in the same domain. An OSOA SCA client also can use this API as an alternative to wiring a reference in the composite file.

The SCA service must be deployed, running, and accessible over the default binding, <binding.sca>.

Procedure

  • Obtain a service proxy for an OASIS SCA service in the same domain.
    The following example shows how to use the OASIS SCAClientFactory API:
    import org.oasisopen.sca.client.SCAClientFactory
    SCAClientFactory scaClientFactory = SCAClientFactory.newInstance(URI.create("default"));
    EchoService echoService = scaClientFactory.getService(EchoService.class, "SCASimpleEchoService");
  • Obtain a service proxy for an OSOA SCA service in the same domain.
    The following example shows how to use the product CompositeContext API:
    import com.ibm.websphere.sca.context.CurrentCompositeContext;
    import com.ibm.websphere.sca.context.CompositeContext;
    CompositeContext compositeContext = CurrentCompositeContext.getContext();
    EchoService echoService =
      (EchoService) compositeContext.getService(EchoService.class, "SCASimpleEchoService");
    

What to do next

To improve performance, the caller can cache the service proxy that is returned by SCAClientFactory.getService() or CompositeContext.getContext(). Caching echoService in the example can avoid calls to the service registry for subsequent requests, resulting in better performance.