Wednesday 27 February 2013

CI Based WebService from PeopleSoft to 3rd Party System



CI Based Web Service

In this example we will create a web service in PeopleSoft based on a component interface which will be then consumed by a third party system.

Step 1 –Create a Component in PeopleSoft System.

We have created a simple page and component based on which we will create out component interface.


Create a component interface based on this component.



Step 2 – Create Service and Service Operation based on the component interface.



Select the service operations that you want to give access to.







Now, the service operations are created for Get and Create methods.


Step 3 – Provide security to the generated service operations.
 

Click on the link Service Operation Security and assign permission list to it and give full access.

 




Step 4 – Create web service based on the above generated service.



Step 5 – View the request templates.



 



<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/">
  <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken>
        <wsse:Password>PTDMO</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </soapenv:Header>
  <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <Get__CompIntfc__DR_EMP_CI xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/M648264.V1">
      <EMPLID>XYZ</EMPLID>
    </Get__CompIntfc__DR_EMP_CI>
  </soapenv:Body>
</soapenv:Envelope>


Sample Create Request

<?xml version="1.0"?>
<soapenv:Envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing/" xmlns:xsd="http://www.w3.org/2001/XMLSchema/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance/">
  <soapenv:Header xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <wsse:Security soap:mustUnderstand="1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <wsse:UsernameToken>
        <wsse:Password>PTDMO</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </soapenv:Header>
  <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <Create__CompIntfc__DR_EMP_CI xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/M1052695.V1">
      <EMPLID>XYZ</EMPLID>
      <NAME>XYZ</NAME>
    </Create__CompIntfc__DR_EMP_CI>
  </soapenv:Body>
</soapenv:Envelope>


Step 6 – Test the web service

Here, we are using SOAP UI tester.

Create a new project.
 

Give a project name and provide the above generated WSDL.


 


Click on Request 1 of Employee Get. Here we will get the employee name of the employee identified by tag EMPLID.



In the response message we can see the fetched employee name.


Now, access Create Operation


We will insert a new employee id 7.
 

Response Message



 


Here, we can confirm that the employee id was successfully inserted.