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


Resolve SCA references

During application assembly or deployment, a reference (a service dependency) is typically resolved to an actual deployed SCA service.

There are two ways to resolve a Service Component Architecture (SCA) reference:

Resolve an SCA reference using the @target attribute

Use this option when the target service is another SCA service that is in the same domain as the client component, or rather, the component with the reference.

When we have configured the SCA default binding for your SCA service, the @target attribute is typically used to resolve an SCA client reference to the SCA component service. We can also use the @target attribute to resolve an SCA reference when using the SCA non-default bindings. Using this mechanism, the client does not need to know the endpoint of a service that is calculated during run time in order to resolve to it. Whereas a binding-specific endpoint can contain server-specific information such as an Hypertext Transfer Protocol (HTTP) port for a web service binding, the @target attribute does not require an update when the client-service pair is deployed to a new server with different ports. We can also redeploy a target service within the domain from a single server to a cluster without requiring a change to the reference-side composite definition. If you use this approach, remember that use bindings of the same type, meaning that the reference must share a common binding with the service it is targeting.

Resolve an SCA reference using a binding-specific endpoint

We must resolve an SCA reference using a binding-specific endpoint if you invoke non-SCA services over non-default bindings or if we have compatible SCA services that are hosted in another domain.

In general, obtain the binding-specific endpoint from the service provider.

If your target service is another SCA service, see the documentation for configuring the particular SCA binding to learn more about which binding-specific endpoint is used for a given service deployment over a particular binding.


Procedure

  1. Determine from the service provider whether the service that you are consuming is an SCA service within the same domain as your client.
  2. Determine the binding that your client uses to consume this service.

    If the target service is an SCA service, the binding that you use is based on the bindings over which the service is exposed. If the service is not an SCA service, the binding depends on the technology over which the service is provided. For example, services offered over SOAP/HTTP use the SCA web services binding.

  3. If the SCA service is hosted in the same domain as your client, use the @target attribute to resolve a reference to a component service within the domain.

    The following examples demonstrate using the @target attribute. The syntax for the <reference> element is the same for the different SCA binding types.

    • SCA default binding

      Target component

      <component name="TargetComponent">
      <service name="BankService"/>
      </component> 

      Client component

      <component name="ClientComponent">
      <reference name="myReference" target="TargetComponent"/>
      </component> 
    • SCA Web Services Binding

      Target component

      <component name="TargetComponent">
      <service name="BankService">
      <interface.wsdl ….>
      <binding.ws/>
      </service>
      </component> 

      Client component

      <component name="ClientComponent">
      <reference name="myReference" target="TargetComponent">
      <interface.wsdl ….>
      <binding.ws/>
      <!-- The client does not have to specify endpoint details. -->
      </reference>
      </component> 
    • SCA Atom binding

      Target component

      <component name="NewsServiceComponent">
      <service name="NewsService">
      <t:binding.atom uri="/newsService"/>
      </service>
      </component> 

      Client component

      <component name="NewsComponent">
      <reference name="newsServiceRef" target="NewsServiceComponent/NewsService">
      <t:binding.atom/>
      <!-- The client does not need to specify endpoint details -->
      </reference>
      </component> 
    • SCA HTTP binding

      Target component

      <component name="Catalog">
      <service name="Catalog">
      <t:binding.http>
      <t:wireFormat.jsonrpc/>
      </t:binding.http>
      </service>
      </component> 

      Client component

      <component name="Store">
      <t:implementation.widget location="store.html"/>
      <reference name="catalog" target="Catalog/Catalog">
      <t:binding.http/>
      <!-- The client does not need to specify endpoint details -->   
      <t:wireFormat.jsonrpc/>
      </t:binding.http>
      </reference>
      </component> 

  4. Resolve the SCA reference by using a binding-specific endpoint if you are invoking non-SCA services over non-default binding or if we have compatible SCA services that are hosted in another domain.

    The following examples demonstrate using the binding-specific endpoint for the client component:

    • SCA web service client component
      <component name="ClientComponent">
      <reference name="myReference">
      <!-- The exact URL is obtained from a service provider. -->
      <binding.ws uri=”http://www.mybank.com:9080/MyBank/AccountService/services>
      </reference>
      </component> 
    • SCA binding.atom client component
      <component name="Aggregator">
      <reference name="atomFeed1">
      <t:binding.atom
            uri="http://www.ibm.com/developerworks/views/webservices/rss/libraryview.jsp"/>
      </reference>
      </component> 
    • SCA binding.http client component
      <component name="Store">
      <reference name="catalog">
      <t:binding.http uri="/catalog">
      <t:wireFormat.jsonrpc/>
      </t:binding.http>
      </reference>
      </component> 

    See the documentation for configuring the particular SCA binding to learn more about binding-specific endpoint resolution for these SCA binding types.


Results

You have identified your SCA client's reference to a target service that it will consume.
Route HTTP requests to an SCA service when using an external web server
Specify bindings in an SCA environment
Configure the SCA default binding
Use the SCA default binding to find and locate SCA services
Configure the SCA web services binding
Configure web service binding custom endpoints to support a proxy server
Configure EJB bindings in SCA applications
Use EJB bindings in SCA applications in a cluster environment
Develop SCA services from existing WSDL files
Develop SCA services with existing Java code
wsimport command for JAX-WS applications
Manage policy sets
Use Atom bindings in SCA applications
Use HTTP bindings in SCA applications


Related


Service Component Architecture specifications and APIs

+

Search Tips   |   Advanced Search