Thursday, 28 August 2014

DYNAMIC PARTNER LINK IN BPEL

Problem: Accessing external service from the BPEL process where the address of the external services will be updated during runtime.

To start with create a  xsd of this type:


Example :



<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://www.oracle.com" targetNamespace="http://www.oracle.com"
            elementFormDefault="qualified">
  <xsd:element name="EndpointURLs">
    <xsd:annotation>
      <xsd:documentation>
        A sample element
      </xsd:documentation>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element name="EndPoint" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>



Create a local variable and assign the element  to above xsd :





 Assign the input xml stream to the variable just created above step:





Xml in from clause:

<EndpointURLs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.oracle.com xsd/common.xsd" xmlns="http://www.oracle.com">
  <EndPoint>your_host/si-employee-connector/proxy/employeePS</EndPoint>
</EndpointURLs>
 
 This endpoint will b hit in run time.



Your complete Bpel looks like this :





Double click on invoke activity->select properties->click   + button->provide details as mentioned below.(loopcounter is variable of foreach loop,snapshot below)
 


























 Double click on foreach and put values as described below :













 Now its done!!!!Deploy and test your services!!!happy learning!!!!!!!

No comments:

Post a Comment