Oracle SOA Suite provides support for specifying multiple partner link endpoint Locations. This capability is useful for failover purposes if the first endpoint is down.
“endpointURI” is the property that we need to add in partner link reference to support multiple endpoint location.
e.g. <property name=”endpointURI”>endpoint</property>
Below is example partner link reference that supports multiple endpoint location
<reference name=”HelloWorld” ui:wsdlLocation=”HelloWorld.wsdl”>
<interface.wsdl interface=”http://xmlns.oracle.com/TestApplication/First/BPELProcess1#wsdl.interface(BPELProcess1)”/>
<binding.ws port=”http://xmlns.oracle.com/TestApplication/Second/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)”
location=”http://localhost:8001/soa-infra/services/default/First/bpelprocess1_client_ep?WSDL”>
<property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/Second/bpelprocess1_client_ep</property>
</binding.ws>
</reference>
Location attribute in the binding.ws tag is default location for the partner link.
e.g. location=http://localhost:8001/soa-infra/services/default/First/bpelprocess1_client_ep?WSDL
Endpoint inside “endpointURI” is the alternate endpoint URI
e.g. <property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/Second/bpelprocess1_client_ep</property>
Here are two use cases to explain more on this. In first use case there is one alternate endpoint and in second one there are two alternate endpoints.
First Use case
We have 3 composites.
- TestComposite
- HelloWorld
- HelloWorldAlternate
TestComposite is calling HelloWorld composite but it should call HelloWorldAlternate composite which is alternate composite in case “HelloWorld” is down.
Sample Partner Link reference
<reference name=”HelloWorld” ui:wsdlLocation=”HelloWorld.wsdl”>
<interface.wsdl interface=”http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.interface(BPELProcess1)”/>
<binding.ws port=”http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)”
location=”http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”>
<property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
</binding.ws>
</reference>
When both “HelloWorld” and “HelloWorldAlternate” composites are up then TestApplication will invoke “HelloWorld” partner link. That means it will take endpoint from “property”
- <property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
When HelloWorld is down then it will invoke “HelloWorldAlternate” partner link. That means it will take endpoint from location attribute of the binding.ws tag
- location=”http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”
Want to Get the FREE Step by Step Guide on How you can create your First SOA Composite in 30 Minutes ?
Image may be NSFW.
Clik here to view.
Second Use case
We can think about having more than one alternative endpoint for partner link.In this case we have 4 composite.
- TestComposite
- HelloWorld
- HelloWorldAlternate.
- HelloWorldSecondAlternate
TestComposite is calling HelloWorld composite but it should call HelloWorldAlternate or HelloWorldSecondAlternate composite which is alternate composite in case “HelloWorld” is down.
Sample Partner Link reference
<reference name=”HelloWorld” ui:wsdlLocation=”HelloWorld.wsdl”>
<interface.wsdl interface=”http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.interface(BPELProcess1)”/>
<binding.ws port=”http://xmlns.oracle.com/TestApplication/HelloWorld/BPELProcess1#wsdl.endpoint(bpelprocess1_client_ep/BPELProcess1_pt)”
location=”http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”>
<property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorldSecondAlternate/bpelprocess1_client_ep</property>
<property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
</binding.ws>
</reference>
When “HelloWorld”, “HelloWorldAlternate” and “HelloWorldSecondAlternate” is up then “TestApplication” will invoke “HelloWorld” partner link. That means it will take endpoint from second “property”
<property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
When “HelloWorld” is down, “HelloWorldAlternate” and “HelloWorldSecondAlternate” is up then “TestApplication” will invoke “HelloWorldAlternate” partner link.
- location=”http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL”
When “HelloWorld” is up, “HelloWorldAlternate” is up and “HelloWorldSecondAlternate” is down then “TestApplication” will invoke “HelloWorld” partner link.
- <property name=”endpointURI”>http://localhost:8001/soa-infra/services/default/HelloWorld/bpelprocess1_client_ep</property>
When “HelloWorld” is down, “HelloWorldAlternate” is up and “HelloWorldSecondAlternate” is down then “TestApplication” will invoke “HelloWorldAlternate” partner link.
- location=http://localhost:8001/soa-infra/services/default/HelloWorldAlternate/bpelprocess1_client_ep?WSDL
Remember : Schema should be same for all the composites.
Want to Get the FREE Step by Step Guide on How you can create your First SOA Composite in 30 Minutes ?
Image may be NSFW.
Clik here to view.Interested to take your SOA Developer Career to next level ? If Yes, then visit : https://k21academy.com/soa-suite-development/workshop/ to know more or check out SOA Development Workshop Here
The post Oracle SOA 11g: Multiple Runtime Endpoint Locations for Partner Link appeared first on Oracle Trainings.