There are a number of ways to implement SOAP transactions in PeopleSoft. Here we are demonstrating the use of simple PeopleSoft SOAP classes. The goal of this exercise is for some third party system to send an OPRID and a SSN to our system, we will respond with a true or false message depending on whether the SSN is actually valid.
N.B. SSN's are not meant to be transmitted in the open so your SOAP gateway should always be protected via SSL or tcprules or something to that effect.
The client will post a message to the PeopleSoft Integration Gateway. The two parameters that our SOAP service receives are “OPRID” and “SSN”. In the message below, the third party client is trying to verify that OPRID = “bob_smith” actually has the SSN = “999999999”:
<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ValidateSSN> <OPRID>bob_smith</OPRID> <SSN>999999999</SSN> </ValidateSSN> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
“OnRequest” PeopleCode will fire, parse the request XML and will return a response that looks like:
tbd
The PeopleCode below, parses out the request message, uses the “SQLExec” statement to verify that the SSN is accurate, and returns and XML response to the caller.
/*********************************************/ /* CUST399 - 02/25/2005 - Ayush Zutshi */ /* Provide SSN Validation to 3rd party via */ /* SOAP Web Service */ /*********************************************/ Local XmlDoc &request, &response; Local string &ssn, &result, &req_oprid, &req_ssn; Local boolean &error; Local SOAPDoc &soapReq, &soapRes; /* Process the request() */ &request = GetMessageXmlDoc(); &soapReq = CreateSOAPDoc(); &soapReq.XmlDoc = &request; &OK = &soapReq.ValidateSOAPDoc(); &req_oprid = &soapReq.GetParmValue(1); &req_ssn = &soapReq.GetParmValue(2); /* Validate the SSN */ SQLExec("select S.NATIONAL_ID from PSOPRDEFN O, PS_PERS_NID S where O.OPRID = :1 and O.EMPLID = S.EMPLID and S.NATIONAL_ID_TYPE= 'PR'", &req_oprid, &ssn); If &ssn = &req_ssn Then &result = "True"; Else &result = "False" End-If; /* Assemble the Response */ &soapRes = CreateSOAPDoc(); &soapRes.AddMethod("ValidateSSN", 0); &soapRes.AddParm("Result", &result); &OK = &soapRes.ValidateSOAPDoc(); /* Return the Response */ &response = &soapRes.XmlDoc; ReturnToServer(&response);
Content-type: text/xml; charset=UTF8 SOAPAction:#NX_VALIDATE_SSN#PSFT_HR#<password>#PSFT_HR
http://[email protected]:7050/PSIGW/HttpListeningConnector