Resolving SCA references

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

About this task

There are two ways to resolve a Service Component Architecture (SCA) reference:
  • Using the @target attribute in order to resolve a reference to a component service within the domain
  • Using a binding-specific endpoint using the @uri attribute of the binding element
Resolving 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 you 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. You 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. You 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 you must use bindings of the same type, meaning that the reference must share a common binding with the service it is targeting.

Resolving an SCA reference using a binding-specific endpoint

You must resolve an SCA reference using a binding-specific endpoint if you invoke non-SCA services over non-default bindings or if you 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 service 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 service 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>
    • New or updated for this feature pack 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>
    • New or updated for this feature pack 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 you 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>
    • New or updated for this feature pack 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>
    • New or updated for this feature pack 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.




In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 21, 2010 7:37:48 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v701sca&product=was-nd-mp&topic=tsca_resolve_references
File name: tsca_resolve_references.html