WAS v8.5 > Develop applications > Develop SCA composites > Specify bindings in an SCA environment

Configure the SCA default binding

We can configure the SCA default binding for services and references. Bindings determine how a component communicates with the world outside its domain. Services use bindings to describe the access mechanism that clients must use to call the service. References use bindings to describe the access mechanism used to call a service. The SCA binding is also referred to as the default binding. The default binding is the binding used when no other binding is specified for a configuration of a component reference or service. Use this binding when an SCA client invokes an SCA service in the same domain. It is not intended to be interoperable in any way with other implementations of SCA runtime environments.


Results

You have implicitly or explicitly configured the SCA default binding for the SCA service or reference.


Example

The following examples illustrate multiple scenarios for configuring the SCA default bindings.


Top level composite with SCA service binding

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://mysca/samples" name="MyComposite"> 

      <component name="HelloWorldServiceComponent">          <implementation.java class="test.HelloWorldImpl"/>       </component> 

   </composite>


Top level composite with SCA reference binding

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"  targetNamespace="http://mysca/samples"
       name="ClientComposite"> 


      <component name="ClientComponent">         <implementation.java class="test.GreetingsServiceImpl"/> 
        <reference name="helloWorldService" target="TargetComponent"/> 
      </component> 

   </composite> 
OR:

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"  targetNamespace="http://mysca/samples"
        name="ClientComposite"> 


      <component name="ClientComponent">         <implementation.java class="test.GreetingsServiceImpl"/> 
        <reference name="helloWorldService" target="TargetComponent/HelloWorld"/>         <!-- compName/serviceName --> 
        </component> 

   </composite>


Top level composite with SCA service binding with transaction policy attribute defined

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"  targetNamespace="http://neworder/sca/jdbc"
       name="NewOrderComposite"> 


      <component name="NewOrderServiceComponent">          <service name="NewOrderService" requires="propagatesTransaction.false"/> 
         <implementation.java class="neworder.sca.jdbc.NewOrderServiceImpl" requires="managedTransaction.local"/>       </component> 

   </composite>


Top level composite with SCA service binding supporting WSDL interface

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"  targetNamespace="http://mysca/samples"
         name="ClientComposite"> 

        <component name="ClientComponent"> 
           <service name="HelloWorldService">              <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/>            </service> 
          <implementation.java class="test.HelloWorldImpl"/>          </component> 

   </composite>


Top level composite with SCA reference binding supporting WSDL interface

<?xml version="1.0" encoding="UTF-8"?> 
    <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://mysca/samples" name="ClientComposite"> 


       <component name="ClientComponent">          <implementation.java class="test.GreetingsServiceImpl"/>          <reference name="helloWorldService" target="MyServiceComponent">             <interface.wsdl interface="http://helloworld#wsdl.interface(HelloWorld)"/>          </reference>        </component> 
</composite>


Intra composite over SCA default binding

<?xml version="1.0" encoding="UTF-8"?> 

   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://mysca/samples"
         name="Service1Composite"> 

       <component name="HWServiceComponent">          <implementation.java class="test.HelloWorldImpl"/>          <reference name="component2Ref" target="Component2"/>       </component> 


        <component name="Component2">         <implementation.java class="test.Component2Impl"/>         </component> 

   </composite>


SCA Service with workManager specified for the service

<?xml version="1.0" encoding="UTF-8"?> 
   <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"  xmlns:wm="http://www.ibm.com/xmlns/prod/websphere/sca/1.0/2007/06"
         targetNamespace="http://mysca/samples" name="Composite2"> 

      <component name="Component2">         <service name="OneWayService">           <!-- This service uses the @oneway annotation to specify this operation only has an input message                 and no output message.   -->             <wm:workManager value="wm/scatest"/>             <!-- This service specifies a workManager where the jndiName is wm/scatest. -->         </service>         <implementation.java class="test.Component2Impl"/>         <reference name="component3" target="Component3"/> 
      </component> 


      <!-- component service with @oneway (non blocking operation -->       <component name="Component3"> 
        <!-- By not defining the workManager, the SCADefaultWorkmanager that is created by the SCA 
             runtime environment is used here. -->         <implementation.java class="test.Component3Impl"/>       </component>  

   </composite>

Deploy the SCA component or application.


Subtopics


Related


Specify bindings in an SCA environment
Manage policy sets


Reference:

Service Component Architecture specifications and APIs


+

Search Tips   |   Advanced Search