Wednesday, May 6, 2009

Manipulating Child Rows in A PeopleSoft Component Through Web Services

I had this issue when trying to manipulate ID types for a user profile through web service. It was easy to update an existing ID type or to insert a non-existing ID type. For example, look at the following SOAP message:


<soapenv:Body>
<ns1:Update__CompIntfc__USER_PROFILE xmlns:ns1="http://xmlns.oracle.com/Enterprise/Tools/schemas/M274199.V1">
<ns1:UserID>COPYUSER2</ns1:UserID>
<ns1:IDTypes>
<ns1:IDType>EMP</ns1:IDType>
<ns1:Attributes>
<ns1:Fieldname>EmplID</ns1:Fieldname>
<ns1:Recname>PERSONAL_DATA</ns1:Recname>
<ns1:AttributeValue>AA0001</ns1:AttributeValue>
<ns1:AttributeName>EmplID</ns1:AttributeName>
</ns1:Attributes>
</ns1:IDTypes>
</ns1:Update__CompIntfc__USER_PROFILE>
</soapenv:Body>


If ID Type 'EMP' exists for user profile 'TESTUSER', system updates the ID Type's attribute value as 'AA0001'. Or if ID Type 'EMP' doesn't exist with user profile 'TESTUSER', it inserted.

However, this way won't work if we need to remove 'EMP' from 'TESTUSER'. We must adopt an attribute 'CINodeAction' to do the work:


<soapenv:Body>
<ns1:Update__CompIntfc__USER_PROFILE xmlns:ns1="http://xmlns.oracle.com/Enterprise/Tools/schemas/M274199.V1">
<ns1:UserID>TESTUSER</ns1:UserID>
<ns1:IDTypes CINodeAction="delete">
<ns1:IDType>EMP</ns1:IDType>
</ns1:IDTypes>
</ns1:Update__CompIntfc__USER_PROFILE>

As the matter of fact, we can also set value 'update' or 'insert' to 'CINodeAction' for first and second scenacios stated above, and this makes the SOAP message unambiguous and more understandable.

Attribute 'CINodeAction' is not documented, but can be digged from application package SOAPTOCI.

PS: This tip applies up to PeopleTools 8.49. In to-be-released PeppleTools 8.50, property 'action' has been announced together with some other properties.