Thursday, July 31, 2014

Consume Third Party Web Service in PeopleSoft


In this example we will consume a 3rd party web service in our peoplesoft system. The web service we have used is a simple calculator program having four operations – Add, Subtract, Multiply & Divide.


We are on PeopleTools 8.51.15
Before performing the steps please make sure that Integration Broker is configured - Integration Broker Setup

Step 1 – Setup Node


We have to setup a node in PeopleSoft System which will communicate with the external system.
Open the existing node WSDL_NODE.






Copy the node to be used for integration.




Step 2 – Get a Public Web Service

There are many available on the net. We will use this as an example.

http://www.dneonline.com/calculator.asmx?WSDL




It is having four operations – Add, Multiply, Subtract and Divide. We will use these four operations.

Step 2 – Consume the Web Service

 

Navigate to PeopleTools  Integration Broker  Web Services  Consume Web Service



Check the WSDL URL radio button and enter the WSDL.





Select the Operations that you want to use.





Give some friendly message names.






Enter the new node that we have created in the first step.








Step 4 – Enter Connection Information

 

Again, open the node DR_WEB_SERVICE and enter the connector id and Primary URL.




The Primary URL will be - http://www.dneonline.com/calculator.asmx


Now, ping the node to confirm that the setup is correct.






Step 5 – Provide Security

Now, search for the service operations that we have created above.





Give a permission list which is assigned to your user profile.




Similarly, provide the security for other service operations.

Step 5 – PeopleCode to Use Web Service


Review the request and response message and accordingly we will create in peoplecode.
Request
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Add xmlns="http://tempuri.org/">
<intA>int</intA>
<intB>int</intB>
</Add>
</soap:Body>
</soap:Envelope>

Response

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>int</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>



Create a simple page –






On the FieldChange event of Calculate button write the following peoplecode. In this example we are using ADD service operation.








Click on the Calculate button.

Request




Response




No comments:

Post a Comment