PeopleSoft Integration Broker and BPEL (Amazon Web Service)

PeopleSoft Integration Broker and BPEL (Amazon Web Service)

I wanted to integrate PeopleSoft with Amazon web service similar to the one I did before here for Google. But,this time I would like to add BPEL to the mix because that is certainly the way Oracle is taking PeopleSoft in the next version.

It is basically a simple page which will accept a search parameter. Based on the search keyword, the application will go search Amazon web site for books and return the results to PeopleSoft.

Our final PeopleSoft page will look something like this


Amazon WSDL is here.

Prerequisites

  • Before you can use the Amazon web service you need to create an account. You can create a free account for the Amazon web service here. After creating the account for Amazon web you will be provided with Access Key ID, this key is required in order for you to send and receive the messages from Amazon.
  • Since we are going to be integrating the service with BPEL you will need to have JDeveloper (10g, I am still researching how to integrate PeopleSoft with BPEL on JDeveloper 11g) to create the BPEL process and BPEL process manager to deploy the BPEL process developed. You can download them from the oracle web site.
  • Please note that I have made some assumptions regarding the audience who intent to use the steps described below.
      • Knowledge of the PeopleSoft pages, record, application engine and peoplecode.
      • Some working knowledge of the BPEL at least hello world process
      • Some knowledge of XSLT.

Steps

Here are the steps we will follow to create the integration

  1. Create the BPEL process in JDeveoper.
  2. Deploy the process to BPEL process manager.
  3. Test the integration works from BPEL process manager to Amazon.
  4. Configure the PeopleSoft to talk to BPEL process manager
  5. Create a PeopleSoft service operation that consumes the BPEL process we created above.
  6. Create a transform application engine to process the response from Amazon to HTML tags.
  7. Display the response on the PeopleSoft page.
  1. Create the BPEL Process in JDeveloper

  • Create new application in the JDeveloper. Lets us call it PeopleSoftToAmazonV2.

  • Click cancel on the Project create popup.
  • Create new project in the application

  • Select BPEL process project from the projects gallery

    • Select Synchronous BPEL process from the BPEL process creation wizard.

    • Click finish to open the default BPEL process.

    • Since the default BPEL input/output messages take one input and one output we need to change the schema for the input message and output message. Right click on the schema definition and change the schema for input and output as shown below. Amazon item search request needs three mandatory inputs Keywords, ResponseGroup and Searchindex. Since we are going to display total results and Image, Title and price we need these elements in the response message.
    • Create a partner link for the service. Drag the partner link from the component palette on the right side of the BPEL window as shown below.


      • Add invoke activity from the component palette after the receive activity.


    • Connect the invoke activity with the Amazon service by dragging and dropping the invoke activity. Select the itemSearch for the operation from the edit invoke window, auto create the input and output variables.


  • Drag an assign activity in between receive activity and invoke activity. Create copy operations to copy the keywords, search index and response group from in input variable to invoke input variable.




  • Create copy operation to select the access identifier to AWSAccessId. You need to select the expression from the type drop down in the from side of the copy operation.


    • Your final copy operation should look like this


      • Drag another transform activity after the invoke activity


  • Create a transformation double clicking on the transform activity. Make sure source variable is output variable from the invoke activity and target variable is output variable.


    • Map the transformations as follows

      -Add for-each node on the target before the items node .Map tags as follows

      Item/ASIN ———-à ASIN

      – Item/SmallImage/URL———-à ImageURL

      – ItemAttributes/ListPrice/Amount ———-à Price

      – Item/ItemAttributes/Title ——————-àTitle


  1. Deploy the process to BPEL process manager.


    3. Test the service. Logon the BPEL console


    Enter Oracle for keyword, Large for Response Group and Books for search Index.



  2. Configure the PeopleSoft to talk to BPEL process manager

  • Configure the BPEL node properties by changing the process manager URL, BPEL domain. You can get to this screen by clicking on the properties link at the bottom of the Node definitions page


G

5. Create a PeopleSoft service operation that consumes the BPEL process we created above.

  • Get the WDSL from the BPEL Process Manager. Copy the link for the WSDL.

  • Create the service operation using consume web service wizard.

  • Make sure you select the BPEL node you configured before for the WSDL node

  • Note the service operation name. In my case, since I already have an operation named “PROCESS”, wizard created a new unique operation name PROCESS39474. This name is required when you create the code to call the BPEL process.

  • Create a simple page with a button to test our integration so far. Enter the code below behind the field change event of the button.

Local Message &lmsgAmazonRequest, &lmsgAmazonResponse;

Local XmlDoc &lxmldoc;

Local string &lstrXMLString;

&lobjBPEL = create PT_BPEL:BPELUtil();

&lmsgAmazonRequest = CreateMessage(Operation.PROCESS39474, %IntBroker_Request);

&lstrXMLString = “<?xml version=’1.0′?>

<ns1:AmazonItemSearchV2ProcessRequest xmlns:ns1=’http://xmlns.oracle.com/AmazonItemSearchV2′&gt;

<ns1:KeyWord>oracle</ns1:KeyWord>

<ns1:ResponseGroup>Large</ns1:ResponseGroup><

ns1:SearchIndex>Books</ns1:SearchIndex><

/ns1:AmazonItemSearchV2ProcessRequest>”;

WinMessage(&lstrXMLString, 0);

&lxmldoc = CreateXmlDoc(&lstrXMLString);

&lmsgAmazonRequest.SetXmlDoc(&lxmldoc);

&lmsgAmazonResponse = &lobjBPEL.launchsyncBPELProcess(“PROCESS”, &lmsgAmazonRequest, “”, “”);

WinMessage(&lmsgAmazonResponse.GenXMLString(), 0);

  • Test the code. When you the code it should you should see two winmessages as follows one for request and one for response



6. Create a transform application engine to process the response from Amazon to HTML tags.

  • Now that we know our integration works, we need to just make sure our page looks little pretty. We can process the response using SOAPDoc API but it will much easier to do it using XSLT and transform it to HTML tags using XSLT application engine. So create an transform application engine process with the following code. Make sure you change the application engine type to transform in the application engine properties and select XSLT as the transform type.



    Here is the code for the XSLT transform

<?xml version=”1.0″?>

<xsl:transform version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform&#8221; xmlns:env=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:res=”http://xmlns.oracle.com/AmazonItemSearchV2&#8243; xmlns:ns1=”http://xmlns.oracle.com/AmazonItemSearchV2″&gt;

<xsl:template match=”/”>

<table border=”1″>

<tr>

<td>Total Search Results</td>

<td><xsl:value-of select=”env:Envelope/env:Body/res:AmazonItemSearchV2ProcessResponse/ns1:TotalResults”/></td>

</tr>

<xsl:for-each select=”env:Envelope/env:Body/res:AmazonItemSearchV2ProcessResponse/ns1:Items”>

<tr>

<td><IMG><xsl:attributename=”src”>

<xsl:value-of select=”ns1:ImageURL”/></xsl:attribute></IMG>

<br><xsl:value-of select=”ns1:Price”/></br></td>

<td><xsl:value-of select=”ns1:Title”/></td>
</tr>
</xsl:for-each>
</table>

</xsl:template>

</xsl:transform>

  • Change the routings on the operation to call the transform function.


  • Add HTML object to the page


  • Populate the HTML object the response from the BPEL in the button peoplecode

    Here is final peoplecode behind the button after removing the winmessages we added before and adding line of code to populate the HTML object and changing the hardcoded keyword to accept keyword from the page.

    import PT_BPEL:*;

    Local Message &lmsgAmazonRequest, &lmsgAmazonResponse;
    Local XmlDoc &lxmldoc;
    Local string &lstrXMLString;

    &lobjBPEL = create PT_BPEL:BPELUtil();

    &lmsgAmazonRequest = CreateMessage(Operation.PROCESS39474, %IntBroker_Request);

    &lstrXMLString = “” | MY_AMZN_IB_WRK.PTACEDUMMYFLD3.Value | “LargeBooks”;

    &lxmldoc = CreateXmlDoc(&lstrXMLString);
    &lmsgAmazonRequest.SetXmlDoc(&lxmldoc);
    &lmsgAmazonResponse = &lobjBPEL.launchsyncBPELProcess(“PROCESS”, &lmsgAmazonRequest, “”, “”);

    MY_AMZN_IB_WRK.WSDLHTML.Value = &lmsgAmazonResponse.GenXMLString();

  • Test our final page

And we have our final page.

Later some time, I will try to blog about the direction oracle is going to take the fusion applications with respect to
PeopleSoft and my opinion regarding that based on my review of the JDeveloper preview 4.Until then…..

Advertisements

7 Comments on “PeopleSoft Integration Broker and BPEL (Amazon Web Service)”

  1. TUT says:

    i am not able to access the methods of the amazon wsdl .when i use the wsdl in definin the partner link the invoke activity fails to identify the operations exposed thru the wsdl.have tried using the wsdl saved as a local file and also while being connected to the internet.please help

  2. Kumar says:

    I get the following message when I deploy BPEL.

    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: ecs.amazonaws.com: ecs.amazonaws.com

    </remoteFault

  3. sravya says:

    Hi,

    Consuming Amazon WSDL on BPEL is fine. It working good on BPEL Console. On PeopleSoft side when i configuration of BPEL node Gateway ID is LOCAL; Connector ID is HTTPTARGET; Conector Properties: HTTPPROPERTY Method POST
    PRIMARYURL URL “http://:/orabpel/default/AmazonItemSearch/1.0”

    when i ping the node following error occurs : “Integration Gateway – External System Contact Error (158,10721)”

    but in errorLog.hmtl PS_HOME/webserv/peoplesoft/applications/peoplesoft/PSIGW/errorLog.html
    the error is looges as “HttpTargetConnector:ExternalSystemContactException socket closed
    Exception : Gateway Manager: ExternalSystemContactException”

    and one more thing when i try to Consume the BPEL webservice in PeopleSoft (PeopleTools>Intergration Broker>Web Services>Consume Web Service) the PS system gives following error “Integration Gateway – External System Contact Error (158,10721)”

    can you provide any solution.

    thanks.

  4. Murgude says:

    I get the following message when I deploy BPEL.

    exception on JaxRpc invoke: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: ecs.amazonaws.com: ecs.amazonaws.com

    </remoteFault

  5. Dave Law says:

    Hi sravya, I’m getting the same error. Did you manage to identify and fix the problem ? If so pls let me know.

  6. Raju says:

    After deploying the BEPL process, I tried to invoke the BPEL process by Entering the following parameters
    Oracle for keyword,
    Large for Response Group
    and Books for search Index.
    I am getting the following error message after clicking the Invoke button.

    ” env:Serveroracle.fabric.common.FabricInvocationException: Unable to invoke endpoint URI “https://webservices.amazon.fr/onca/soap?Service=AWSECommerceService” successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targetUnable to invoke endpoint URI “https://webservices.amazon.fr/onca/soap?Service=AWSECommerceService” successfully due to: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”

    Please help me to trigger out from this error.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s