CopyToPSFTMessage method: XmlDoc class
Syntax
CopyToPSFTMessage(targetDoc, srcPath, targetPath)
Description
Use the CopyToPSFTMessage method to copy an XmlDoc to a PeopleSoft message. The srcPath and targetPath parameters enable you to map the data of the XmlDoc (using the XmlDoc structure) to the message (following the message structure.)
The XmlDoc object generally has the following structure:
<?xml version="1.0"?>
<MESSAGE_NAME>
<FieldTypes>
...
</FieldTypes>
<MsgData>
<Transaction>
...
</Transaction>
</MsgData>
</MESSAGE_NAME>
Parameters
| Parameter | Description |
|---|---|
|
targetDoc |
Specify the XmlDoc that contains the message structure. |
|
srcPath |
Specify an array of string that contains the mapping path information. |
|
targetPath |
Specify an array of string that contains the mapping path information. |
Returns
A number. The values are:
| Value | Description |
|---|---|
|
0 |
Ok |
|
1 |
Missing PSCAMA structure |
|
2 |
Missing FieldType structure |
|
3 |
General Error |
Example
Local XmlDoc &srcDoc, &targetDoc;
Local array of string &srcPath, &targetPath;
&srcPath = CreateArrayRept("", 0);
&targetPath = CreateArrayRept("", 0);
&srcDoc = CreateXmlDoc("");
&targetDoc = CreateXmlDoc("");
&ret = &srcDoc.ParseXmlFromURL("c:/temp/source.xml");
&ret = &targetDoc.ParseXmlFromURL("c:/temp/target.xml");
&srcPath.Push("QE_EMPLOYEE");
&srcPath.Push("QE_EMPLOYEE/QE_ACCOUNT_TBL");
&srcPath.Push("QE_EMPLOYEE/QE_JOBCODE");
&srcPath.Push("QE_EMPLOYEE/DEPTID");
&srcPath.Push("EMAIL_MSG_RCD");
&srcPath.Push("EMAIL_MSG_RCD/EMAIL_FILE_RCD");
&targetPath.Push("QE_EMPLOYEE_TG");
&targetPath.Push("QE_EMPLOYEE_TG/QE_ACCOUNT_TBL_TG");
&targetPath.Push("QE_EMPLOYEE_TG/QE_JOBCODE_TG");
&targetPath.Push("QE_EMPLOYEE_TG/DEPTID_TG");
&targetPath.Push("EMAIL_MSG_RCD_TG");
&targetPath.Push("EMAIL_MSG_RCD/EMAIL_FILE_RCD_TG");
&ret = &srcDoc.CopyToPSFTMessage(&targetDoc, &srcPath, &targetPath);