Thursday, May 6, 2010

more on SCA configuration file in SOA 11g

Introducing SCA

In this blog I will be explaining the basic structure and components involved in composite.xml which as you all know is the master configuration file of a composite application. This file uses an XML-based format called the Service Component Definition Language to describe the components and specify how they relate to one another. As you know in an increasingly SO world the interaction between components should be modeled as services, cleanly separating the implementation technology from the function that’s provided.

There are some terminologies that you need to be familiar when it comes to using the SCA model in SOA 11g.

The fundamental elements of a SCA SCDL are:

· Component

SCA defines a basic atom as a component. The implementation of each component can be done using any technology. Implementation.<tech> tag inside the <component> tag will specify the component used to implement that component. It can be BPEL, Mediator, Human Workflow, Java class, Business Rules or any other supported technology.

· Composites

Components can be combined into larger structures called composites. The composite.xml is used as the configuration file to define the composite application. It is defined using the SCDL language. (Service Component Definition Language)

· References

Whenever a component needs the services of other components it uses references. Each reference defines an interface containing operations that the component needs to invoke

· Bindings

Bindings specify how that communication happens. There can be multiple bindings, and the binding to be used will be determined at runtime.

· Wire

A reference is connected to a service using a wire. A wire is an abstract representation of the relationship between a reference and some service that meets the needs of that reference.

· Service

A composite can also expose one or more services. These services are actually implemented by components within the composite.

Code Snippet :: composite.xml

<composite name="MyExample" .>

<component name="Component1">

<implementation.bpel process="Process1"/>

</component>

<component name="Component2">

<implementation.java class="com.geo.HellloWorld"/>

</component>

<component name="RouteRequest">

<implementation.mediator src="RouteRequest.mplan" />

</component>

<component name="ManualApprovalTask">

<implementation.workflow src="ManualApproval.task" />

</component>

<component name="ManualApprovalRule">

<implementation.decision src="ManualApprovalRule.decs" />

</component>

<reference name="FileWrite" ui:wsdlLocation="FileWrite.wsdl">

<interface.wsdl interface="http://geo.com/FileWrite#wsdl.interface(Write_ptt)" />

<binding.jca config="FileWrite_file.jca" />

</reference>

<reference name="getStatus" ui:wsdlLocation="http://<host>:port/soa-infra/services/default/CCValidation!1.0/GetStatus.wsdl">

<interface.wsdl interface="http://geo.com/GetStatus#wsdl.interface(execute_ptt)" />

<binding.ws port="http://geo.com/GetStatus#wsdl.endpoint(GetStatusByCC/execute_pt)" location="http://host:port/soa-infra/services/default/CCValidation!1.0/GetStatus?WSDL" />

</reference>

<wire>

<source.uri>RouteRequest/FileWrite</source.uri>

<target.uri>FileWrite</target.uri>

</wire>

<service name=“ HelloWorld” ui:wsdlLocation="HelloWorld.wsdl">

<interface.wsdl interface="http://geo.com/recieveHello#wsdl.interface(execute_ptt)"/>

<binding.ws/>

<service/>

</composite>

The SCDL configuration file’s implementation element tells the runtime both what kinds of containers it needs for a particular composite and where to find the implementations of the components in that composite .The SCA runtime provides all bindings, allowing components created using any technology to use any available binding. Hope this helps J

2 comments:

AG said...

This is invaluable stuff...big thanks for sharing your knowledge...

sampath said...

thanks a lot.. keep on posting SOA 11g examples...