Wednesday, July 21, 2010

Decomposing Composite.xml –Part1

writera

In one of my previous blog, I had written on the different components that make up a composite (composite.xml). In this blog, I will try to go a layer deeper and disintegrate the composite.xml file to explain the different values that need to go into each attribute of the main element tags. This will be helpful in case you are writing your own composite.xml or trying to migrate from SOA10g versions to 11g. I will be concentrating more on the service and references tags in this write-up.

Service Element

Synchronous Service

First we will see how a synchronous service is represented in a composite.xml.

Sync Service XML Code snippet Template (Composite.xml)

<service name=" Service Name” ui:wsdlLocation=" URL of abstract wsdl " >

<interface.wsdl interface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the WSDL]"

<binding.ws port="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Service Port as per WSDL])" location="[URL of the concrete WSDL]"/>

<service>

The attributes corresponding to each element is explained below.

1. attribute name in Service element = [ Sync service name]

2. attribute ui:wsdlLocation in Service element = [URL of the abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the WSDL]

4. attribute port in binding.ws element = [Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the WSDL]

5. attribute location in binding.ws element = [URL of the concrete WSDL]

For example::

<service name=" SyncEmployeeService " ui:wsdlLocation="oramds:/apps/geo/service/Employee/SyncEmployee.wsdl" >

<interface.wsdl interface="http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequest)"

<binding.ws port="http://xmlns.geo.com/service/Employee#wsdl.endpoint(SyncEmployeeService_ep/ EmployeeService_pt)"/>

<service>

Asynchronous Service

Now we will see how an Asynchronous service is represented in a composite.xml.

Async Service XML Code snippet Template (Composite.xml)

<service name=" Async Service Name” ui:wsdlLocation=" URL of abstract wsdl " >

<interface.wsdl interface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the WSDL]"

callbackInterface="[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Response PortType as per the WSDL]"/>

<binding.ws port="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Request Service Port as per WSDL])" location="[URL of the concrete WSDL]"/>

<callback>

<binding.ws port ="[Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per WSDL]/[ Name of the Response Service Port as per WSDL])" />

</callback>

<service>

1. attribute name in service element = [Async service name]

2. attribute ui:wsdlLocation in service element = [URL of the abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the WSDL]

4. attribute callbackInterface in interface.wsdl element =[Namespace of the Service as defined in the wsdl]#wsdl.interface[Name of the Response Port as given in the WSDL]

In case if you are not finding the response port of the service then wsdl.endpoint can be given as [Name of the Porttype element as given in the WSDL]_ep.

5. attribute port in binding.ws element = [Namespace of the Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the WSDL]

6. attribute location in binding.ws element = [URL of the concrete WSDL]

For example ::

<service name="AsyncEmployeeService" ui:wsdlLocation="oramds:/apps/geo/service/Employee/AsyncEmployee.wsdl" >

<interface.wsdl interface="http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequest)"

callbackInterface=" http://xmlns.geo.com/service/Employee#wsdl.interface(EmployeeRequestCallback)"/>

<binding.ws port=" http://xmlns.geo.com/service/Employee #wsdl.endpoint(AsyncEmployeeService_ep/AsyncEmployeeService_pt)" location="” />

<callback>

<binding.ws port=" http://xmlns.geo.com/service/Employee#wsdl.endpoint(AsyncEmployeeService_ep/AsyncEmployeeService_pt)"/>

</callback>

<service>

Concrete WSDL URL for services deployed on SOA server

http://{host}:{port}/soa-infra/services/default)/[ Name of the Service as given in the attribute name of the element definition in the WSDL]/[Name of the Porttype element as given in the WSDL]?WSDL

References Element

Synchronous Reference

Now we will see how an Synchronous reference service is represented in a composite.xml.

Sync Reference XML Code snippet Template (Composite.xml)

<reference name="Sync Reference name" ui:wsdlLocation=" URL of Reference abstract wsdl " >

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface ="[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the Reference WSDL]”/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="[Namespace of the Reference Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Service Port as per Reference WSDL])" location="[URL of the Reference concrete WSDL]"/>

</reference>

The attributes corresponding to each element is explained below.

1. attribute name in Service element = [ Sync Reference service name]

2. attribute ui:wsdlLocation in Service element = [URL of the Reference abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as given in the Reference WSDL]

4. attribute port in binding.ws element = [Namespace of the Reference Service as defined in the wsdl]#wsdl.endpoint([Name of the Service as given in the WSDL]/[ Name of the Porttype as given in the Reference WSDL]

5. attribute location in binding.ws element = [URL of the Reference concrete WSDL]

For Example ::

Here the composite snippet which has an external reference to a Sync Person Service

<reference name="SyncReference" ui:wsdlLocation="oramds:/app/geo/references/SyncPerson.wsdl" >

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface="http://xmlns.geo.com/PersonService#wsdl.interface(PersonService)"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="http://xmlns.geo.com/PersonService#wsdl.endpoint(PersonService/PersonService)"

location="http://host:port/soa-infra/services/default/PersonService/client?WSDL"/>

</reference>

Asynchronous Reference

Now we will see how an Asynchronous reference service is represented in a composite.xml.

Async Reference Service XML Code snippet Template (Composite.xml)

<reference name=" Async Reference Service Name” ui:wsdlLocation=" URL of Reference abstract wsdl " >

<interface.wsdl xmlns:ns=http://xmlns.oracle.com/sca/1.0

interface="[Namespace of the Reference Service as defined in the wsdl]#wsdl.interface[Name of the Request PortType as per the Reference WSDL]"

callbackInterface="[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Response PortType as per the Reference WSDL]"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="[Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Request Service Port as per Reference WSDL])" location="[URL of the Reference concrete WSDL]"/>

<callback>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port ="[Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as per Reference WSDL]/[ Name of the Response Service Port as per Reference WSDL])"/>

</callback>

<reference>

1. attribute name in service element = [Asynchronous Reference service name]

2. attribute ui:wsdlLocation in service element = [URL of the Reference abstract WSDL]

3. attribute interface in interface.wsdl =[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Request PortType as given in the Reference WSDL]

4. attribute callbackInterface in interface.wsdl element =[Namespace of the Service as defined in the Reference wsdl]#wsdl.interface[Name of the Response Port as given in the Reference WSDL]

In case if you are not finding the response port of the service then wsdl.endpoint can be given as [Name of the Porttype element as given in the Reference WSDL]_ep.

5. attribute port in binding.ws element = [Namespace of the Service as defined in the Reference wsdl]#wsdl.endpoint([Name of the Service as given in the Reference WSDL]/[ Name of the Porttype as given in the Reference WSDL]

6. attribute location in binding.ws element = [URL of the Reference concrete WSDL]

For Example ::

Here the composite has a external reference to a ASync Person Service

<reference name="AsyncReference” ui:wsdlLocation="oramds:/app/geo/references/AsyncPerson.wsdl">

<interface.wsdl xmlns:ns="http://xmlns.oracle.com/sca/1.0"

interface="http://xmlns.geo.com/AsyncPersonService#wsdl.interface(AsyncPersonService)"

callbackInterface="http://xmlns.geo.com/AsyncPersonService #wsdl.interface(AsyncPersonServiceCallback)"/>

<binding.ws xmlns:ns="http://xmlns.oracle.com/sca/1.0"

port="http://xmlns.geo.com/AsyncPersonService#wsdl.endpoint(AsyncPersonService/AsyncPersonService)"

location="http://host:port/soa-infra/services/default/AsyncPersonService/client?WSDL"/>

<callback>

<binding.ws port="http://xmlns.geo.com/AsyncPersonService#wsdl.endpoint(AsyncPersonService/AsyncPersonService)"/>

</callback>

</reference>

All the attribute values for services and references are similar, only the components as part of a service or reference vary from Synchronous service to asynchronous service to accommodate the callback mechanism. That’s pretty much for the day and month as I am going on vacation. NjoyJ

No comments: