Saturday 26 January 2013

Consume Third Party Web Service in PeopleSoft


Consuming 3rd 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




19 comments:

  1. Wonderful! Thanks for sharing.

    ReplyDelete
  2. Great!, could you please share any examples using REST?

    ReplyDelete
  3. it is really excellent ....Great

    ReplyDelete
  4. Very nice explanation.
    Thanks a bunch!

    ReplyDelete
  5. This is very helpful! Thank you so much for sharing!

    ReplyDelete
  6. Hi, I have a question, in the Step 4 – Enter Connection Information is throwing mistake: LOCAL HTTPTARGET http://www.dneonline.com/calculator.asmx Pasarela Integración - Error Contacto Sistema Externo (158,10721)

    Will you know the why ? Will have something to do with the URL Connector: http://www.dneonline.com/calculator.asmx

    Thanks.

    ReplyDelete
    Replies
    1. Please check if the url is accessible from your web server?

      Delete
    2. Hi Deepak Ray, The url is responding well from my pc.

      But when I ping the node this responds:

      Información Nodo
      ID Pasarela ID Conector URL Conector Texto Mensaje

      LOCAL HTTPTARGET http://www.dneonline.com/calculator.asmx Pasarela Integración - Error Contacto Sistema Externo (158,10721)

      Delete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Hi, After eliminating everything,Try again to consume the WSDL, however the Consume Web Service wizard generate this mistake:

    Gateway Integration - Error External System Contact (158, 10721)

    The integration gateway has not been able to contact the external system. The specified network location is likely to be erroneous or the site is temporarily or permanently unavailable.

    Could you help me, regards.

    ReplyDelete
  9. can you please check the contents of errorlog.html file - /u01/PS_CFG_HOME/pt85510/webserv/HCM92DMO/applications/peoplesoft/PSIGW.war/WEB-INF

    also, i hope IB setup is correct in your system.

    ReplyDelete
  10. Hi, apology for the inconvenience, I realized that from the web server I did not reach the address www.dneonline.com

    Although from my PC I can see the WSDL and this is a security issue that is out of my hands.

    Regards.

    ReplyDelete
  11. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updatingmulesoft online training

    ReplyDelete
  12. How to consume a wsdl which require username and password?

    ReplyDelete
  13. Hi Deepak,
    Excellent document on PeopleSoft web services.
    Would you mind sharing your email address as I have a few questions, Thanks in advance.

    ReplyDelete
  14. Deepak: Good Information thanks for sharing.

    ReplyDelete
  15. Hi Deepak, We are having difficulties as we are trying to consume web service "Cannot establish HTTP connection (158,2842)

    Can be caused by any of the following:
    1. Cannot load certificates due to keystore password (not encrypted).
    2. Keystore file not found.
    3. Proxy server not configured." any help on this is appreciated. Thanks

    ReplyDelete