Testing the REST POST Constituent Staging Service

This section discusses how to test whether you configured the service operation SCC_STG_CONSTIT_R correctly.

The REST (Representational State Transfer) POST Constituent Staging Service is a type of synchronous web service that adheres to REST interface standards. The name of the only service operation implemented in this case so far is POST, which is used to add new data into a table structure. In this case, the table structure is the Constituent Staging table hierarchy. The URL of the operation points to the resource to which data will be added. The payload in the following example is an XML representation of the data to be added. This XML is to be added to a flat file to which you will later reference with a curl command.

  1. Create the XML file SCC_STG_CONSTIT_REQ_R-POST-2023-09-01-10.03.xml using the following content as an example. You can create or edit this example using a text editor on your computer. You can also use any file name.

    <?xml version="1.0"?>
    <CONSTITUENT>
       <BIRTHDATE>04/01/20005</BIRTHDATE>
       <PER_NAMES>
          <PER_NAME>
            <NAME_TYPE>PRF</NAME_TYPE>
            <COUNTRY_NM_FORMAT>001</COUNTRY_NM_FORMAT>
            <NAME>Smith,John</NAME>
            <LAST_NAME_SRCH>SMITH</LAST_NAME_SRCH>
            <FIRST_NAME_SRCH>JOHN</FIRST_NAME_SRCH>
            <LAST_NAME>Smith</LAST_NAME>
            <FIRST_NAME>John</FIRST_NAME>
          </PER_NAME>
          <PER_NAME>
            <NAME_TYPE>PRI</NAME_TYPE>
            <COUNTRY_NM_FORMAT>001</COUNTRY_NM_FORMAT>
            <NAME>Smith,John</NAME>
            <LAST_NAME_SRCH>SMITH</LAST_NAME_SRCH>
            <FIRST_NAME_SRCH>JOHN</FIRST_NAME_SRCH>
            <LAST_NAME>Smith</LAST_NAME>
            <FIRST_NAME>John</FIRST_NAME>
          </PER_NAME>
       </PER_NAMES>
       <EMAIL_ADDRESSES>
          <EMAIL_ADDRESS>
            <E_ADDR_TYPE>HOME</E_ADDR_TYPE>
            <EMAIL_ADDR>john.x2.smith@psunv.edu</EMAIL_ADDR>
            <PREF_EMAIL_FLAG>Y</PREF_EMAIL_FLAG>
          </EMAIL_ADDRESS>
       </EMAIL_ADDRESSES>
       <ADDRESSES>
           <ADDRESS>
             <ADDRESS_TYPE>HOME</ADDRESS_TYPE>
             <COUNTRY>USA</COUNTRY>
             <ADDRESS1>1234 Fifth Street</ADDRESS1>
             <CITY>Newton</CITY>
             <STATE>PA</STATE>
             <POSTAL>12346</POSTAL>
           </ADDRESS>
       </ADDRESSES>   
       <PERSON_DATA_EFFDTS>
          <PERS_DATA_EFFDT>
             <SEX>M</SEX>
          </PERS_DATA_EFFDT>
       </PERSON_DATA_EFFDTS>
       <PERS_NIDS>
          <PERS_NID>
             <COUNTRY>USA</COUNTRY>
             <NATIONAL_ID_TYPE>PR</NATIONAL_ID_TYPE>
             <NATIONAL_ID>556-16-5443</NATIONAL_ID>
          </PERS_NID>
       </PERS_NIDS>
       <PERSON_SAS>
          <PERSON_SA>
             <FERPA>N</FERPA>
          </PERSON_SA>
       </PERSON_SAS>
    </CONSTITUENT>
    
  2. Determine valid fields and values.

    An XML file consists of a top-level tag <?xml version="1.0"?>, followed by one top-level tag <CONSTITUENT>. The </CONSTITUENT> tag ends the <CONSTITUENT> tag. Note that it has a leading slash after the opening bracket. The <CONSTITUENT> tag represents the Constituent entity. See the navigation to entities: Setup SACR > System Administration > Entity > Entity Registry. There are child tags with the <CONSTITUENT> tag that represent the child entities of the Constituent entity.

  3. Issue a curl command to submit the POST request.

    # input...
    > curl -X POST --data @C:\Temp\SCC_STG_CONSTIT_REQ_R-POST-1.xml -v --user PS:PS http://<hostname>:<port>/PSIGW/RESTListeningConnector/<dbname>/SCC_STG_CONSTIT_R.v1/CONSTITUENT/
    
    # output...
    
    Note: Unnecessary use of -X or --request, POST is already inferred.
    ...
    * Server auth using Basic with user 'PS'
    > POST /PSIGW/RESTListeningConnector/<dbname>/SCC_STG_CONSTIT_R.v1/CONSTITUENT/ HTTP/1.1
    ...
    > User-Agent: curl/8.0.1
    > Accept: */*
    > Content-Length: 1629
    > Content-Type: application/x-www-form-urlencoded
    >
    < HTTP/1.1 201 Created
    < Date: Fri, 01 Sep 2023 21:42:02 GMT
    < Content-Length: 180
    < Content-Type: application/xml; encoding=UTF-8
    ...
    <
    <?xml version='1.0'?><CONSTITUENT xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/SCC_STG_CONSTIT_R.SCC_STG_CONSTIT_RESP_R.v1">
    <SCC_TEMP_ID>102</SCC_TEMP_ID></CONSTITUENT>
    ...
    
  4. Run the Transaction Management process.

    • From the Selection Parameters page, make sure to select Process Saved Transaction.

    • From the Search/Match Parameters page, use these parameters:

      • Search Parameter: LNFNNIDSEXDOB

      • Search Result Code: Use the result code of your preference. For example, PSCS_TRAD_RESUL.

      • Duplicate Rule: NIDONLY

  5. Check the process log. Make sure the process was successfully completed.

  6. Check suspended transactions.

    The Search/Match/Post processes zero or more transactions, where a transaction is a one-person constituent structure within the staging table structure. It has one temp ID associated with it. Some of the transactions may be set to "Suspended' status if the search/match/post rule so indicates. A suspended transaction isn't applied to the production tables because there are errors associated with suspended transactions. You would then research and correct the causes of these errors. For example, if it's the same national ID but has a different name.

    1. Select the suspended transaction, then click Search/Match Results link to find out why this happened.

    2. Look at the duplicates. Check for duplicate national IDs (NID).

    3. If there are no duplicate NIDs, check for duplicate names.

    4. If there are many duplicate names, verify the suspend rule on first name and last name duplicates.

    5. Edit the transaction: in Constituent Status, select Add New ID.

    6. Rerun the Transaction Management Process using the same search/match parameters. The process should run successfully, and the transaction log shows that the transaction was posted.

    7. Take note of the new ID that was created.

    8. Look up the new person (Campus Community > Personal Information > Add/Update a Person.) and verify that this person has correct data.