Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop SCA composites > Specify bindings in an SCA environment


Use the SCA default binding to find and locate SCA services

The product supports an API that you can use to find and invoke Service Component Architecture (SCA) services over the SCA default binding.

According to the SCA v1.0 specification, you can only obtain a reference to an SCA service from another component that is statically wired to the service. However, you can use a service proxy to invoke the target service. This function requires a WAS base or network deployment topology with at least one server that supports SCA composites. Also, SCA service must be deployed, running, and accessible over the default binding, <binding.sca>. There is no support for a domain URI, so all requests go to the default domain at the cell level. Using this API enables code that is not an SCA component to use the SCA client programming model.


Procedure

Use the import method in your client code to locate an SCA service.

The following method is supported for client code to locate a service that is deployed onto a cell:

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 the component performance, make the caller of the compositeContext.getService() API cache the SCA default binding service proxy that is obtained from compositeContext.getContext(). Caching echoService in the example can avoid calls to the service registry for subsequent requests, resulting in better performance.
Develop SCA services from existing WSDL files
Develop SCA services with existing Java code
Develop SCA service clients
Specify bindings in an SCA environment


Related


Service Component Architecture specifications and APIs

+

Search Tips   |   Advanced Search