Saturday, April 21, 2018

PSCA Install and Configuration - Upgrade to 9.2

In this POC I am upgrading HCM 9.1 PT 8.53.x to HCM 9.2 PT 8.56.x

VM setup 

  1. I have done native OS installs on Windows 2016 VM of PUM Image 25 (VM name: PUM25) and Upgrade Source 03 (VM Name: UPG03) and those systems are up and running. 
  2. Next I have copy of production up on SQL Server 2014 on a Windows 2016 VM. (VM Name: DB).
  3. I have two other Windows 2016 VMs one for App/Prcs VM and the other for PIA. Native OS - DPK method install of middleware like tuxedo, weblogic and tools, app homes using the command line
  4.           psft-dpk-setup.bat --env_type midtier --deploy_only --deploy_type all

             No domains have been deployed yet
  5. Software is installed on E:/psft (E:\ is local drive on the VM)

PSCA/Oracle Client/PT Client Setup
I am running my PSCA on the App/Prcs VM mentioned above. 
Map drives to E$ on PUM25, UPG03 and \\PUM25\E$\psft\pt\hcm_pi_home

Installed SQL Server Management Studio and related drivers for SQL Server 2014. 

Opened CMD as admin and navigated to \\PUM25\E$\psft\pt\tools_client and ran SetupPTClient.bat -t

This will install Oracle client and Oracle based PT Client on the C:\ drive. This PT Client will be used to connect to PUM25 and/or UPG03.
Also installed PSCA - default location on C:\ drive.

Created 32-bit and 64-bit ODBC connections for my copy of prod database. PT 8.53 just needs 32-bit but when PSCA makes the connectivity test it uses 64-bit version.

Verified that I can connect to PUM24, UPG03 and Copy of Prod via application designer as well as the appropriate SQL tool.

PSCA Configuration
Launch PSCA as admin
Select Update Manager

General Option 
    - PS_HOME - point it to the local install ps_home
    - Create local directories to store download, output and staging and point them appropriately
    - point to SQLCMD.EXE file for SQL Query Tool
PUM Source - point to the Oracle db, SQL Client Tool would be path to sqlplus.exe, PS_HOME, PS_APP_HOME and PS_CUST_HOME would be the Oracle PT client installed in the prior step. 
Don't have to enable any check-boxes
PI_HOME - will be the mapped drive to hcm_pi_home mapped earlier
PIA URL to PUM signon page
Did not enable EM Hub

Upload Upg Source db to PUM
Launch the "Upload Target Database Information to Image" option and select the Upgrade Source database and upload that to the PUM Image.
Once done login to PUM PIA, navigate to PeopleTools > Lifecycle Tools > Update Manager > Update Manager Dashboard and Click on Define Upgrade Package.
Named my package HR91TO92.
Follow prompts select required for upgrade fixes too.
So it should create HR91TO92UPG and HR91TO92RFU. 
Now back in PSCA, Select HR91TO92UPG from the drop-down and it should prompt for downloading HR91TO92RFU too. So download both packages to the download directory.
As we will doing a tools upgrade too at the same time, copy PS_HOME\PTU\updPTU856.zip to the download folder manually.

Selected "Upgrade to New Application Release"
Initial Pass is selected by default
Setup target database - copy of prod
SQL Client tool - will be path to SQLCMD.EXE
Current home - will be the copied hr91 directory, I have one directory which has both tools and app so provided the same path for PS_HOME, PS_APP_HOME and PS_CUST_HOME
Enabled Configure New Homes for Upgrade
Provided paths for new homes the ones created by the DPK install on this VM.

Setup Upgrade Source database - this is similar to the PUM Source database configuration done earlier.

Select Upgrade page - should show Upgrade Source and target information correctly. Application and Tools upgrade sections will be selected and grayed out. Each one should have a package listed under the appropriate section. 
Select the Required for Upgrade Package section.
then continue to compatibility check screen. Verify that all are return green. If anything is not then step through previous screens to verify the inputs and selections. A total of 11 checks are performed.

Click on Finish and the upgrade job will be created and PSCA will start running the steps. The first step is a manual stop.

It creates 3 jobs, RFU, UPG and PT Upgrade.

Thursday, April 19, 2018

SQR: FindFiles

Via peoplecode its very easy to read a directory and fetch filenames - leveraging delivered function "FindFiles". Now try doing the same in SQR. Not trivial at all. 

Here is what I had to do. I am running PT 8.55.x but its pretty much the same in any recent PT versions.
I essentially have to run a dir command at the Windows level get the filenames based on the wildcard and write the filenames to a file. Then read the file for the filenames. Once done, I can delete the temp file which has the list of filenames. if the dir cmd does not return anything for my wildcard search then the temp file will be empty.
The other important thing here is the WAIT parameter for the call system command. If that is not provided then the reading of the temp file does not work, as it takes the system some time to write the contents to the temp file. 

let $comspec = getenv('COMSPEC')
let $TempFile = 'C:\temp\temp_file.txt'
let $FindFiles = $comspec || ' /c dir /b \\my_network_path\share\some_directory\*.pdf > ' ||  $TempFile
call system using $FindFiles #call-status WAIT

open $TempFile as 10 for-reading record=50 #filestat
while 1 
  read 10 into $file-name:50
if $file-name != '' or #end-file
break
end-if
end-while

close 10

! delete text file
let $delCmd = $comspec || ' /c del /F /Q ' || $TempFile 
call system using $delCmd  #call-status WAIT

Way longer than a simple FindFiles command via peoplecode, but this does the trick.

Wednesday, April 4, 2018

PeopleSoft web service response namespace issue

Running PT 8.53.x, wrote a simple custom web service "Hello World". Service works fine but saw one issue where the namespace returned by the response message is not defined in the WSDL. So any other 3rd party solution like a .Net program when they consume and execute this service it fails to receive the response due to the unidentified namespace.

Request 


<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/">
  </soapenv:Header>
  <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <HelloWorld xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/HELLOWORLD.V1"></HelloWorld>
  </soapenv:Body>
</soapenv:Envelope>

Response via PeopleSoft SOAP message template


<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/">
  </soapenv:Header>
  <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <HelloWorldResponse xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/HELLOWORLDRESPONSE.V1">
      <HelloWorldResult>XYZ</HelloWorldResult>
    </HelloWorldResponse>
  </soapenv:Body>
</soapenv:Envelope>

Actual response via SOAPUI or Postman

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <HelloWorldResponse xmlns="http://peoplesoft.com/HelloWorldResponseResponse">
         <HelloWorldResult>Success</HelloWorldResult>
      </HelloWorldResponse>
   </soapenv:Body>
</soapenv:Envelope>


As you see the the problem is the namespace value returned for the root tag "HelloWorldResponse".

<HelloWorldResponse xmlns="http://peoplesoft.com/HelloWorldResponseResponse">


PeopleSoft puts the default value (not sure where this is stored)
http://peoplesoft.com/HelloWorldResponseResponse
instead of what is defined in the WSDL which is 
http://xmlns.oracle.com/Enterprise/Tools/schemas/HELLOWORLDRESPONSE.V1

I have a very basic synchronous service operation, with a request and response message and the handler OnRequest peoplecode is doing all the work.

Following was my application package peoplecode initially.

&response = CreateMessage(Operation.HELLOWORLD_SVCOP, %IntBroker_Response);
&xmldata = "<?xml version='1.0'?><HelloWorldResponse/>";
&xmlresponsedoc = CreateXmlDoc(&xmldata);

&HWResponseNode = &xmlNode.AddElement("HelloWorldResult");
&HWResponseNode.NodeValue = "Success";
&response.SetXmlDoc(&xmlresponsedoc);
Return &response;


So when creating the XmlDoc I was not specifying any namespace and I was hoping PeopleSoft will add it based on the schema definition. 

Instead following is what I had to do to correct the issue. (only displaying the change, no change to rest of the code)

&xmlresponsedoc = CreateXmlDoc("");

&docTypeNode = &xmlresponsedoc.CreateDocumentType("", "", "");
&rootNode = &xmlresponsedoc.CreateDocumentElement("HelloWorldResponse", "http://xmlns.oracle.com/Enterprise/Tools/schemas/HELLOWORLDRESSPONSE.V1", &docTypeNode);

&xmlNode = &xmlresponsedoc.DocumentElement;

So I have to use the CreateDocumentElement method of CreateXmlDoc in order to define the namespace. In order to use this method I had to first initialize the &docTypeNode variable by using the CreateDocumentType method.

After making the above change the response comes back correctly.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <HelloWorldResponse xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/HELLOWORLDRESSPONSE.V1">
         <HelloWorldResult>Success</HelloWorldResult>
      </HelloWorldResponse>
   </soapenv:Body>
</soapenv:Envelope>