Support Article

Parse-XML fails to parse complex XML element

SA-37029

Summary



User is on Pega 7.2.1 and reported that Parse-XML rule fails to parse complex XML element. As an example the following elements have type associated with them in the XML data:

<suppliers type="array">
<supplier>
<id type="integer">3308</id>
<created-at type="dateTime">2017-03-13T22:46:48-07:00</created-at>
<updated-at type="dateTime">2017-03-13T22:46:48-07:00</updated-at>
</supplier>
</suppliers>


Parse-XML fails to parse the value for the elements which are not mapped at all.


Error Messages



Not Applicable.


Steps to Reproduce

  1. Open Designer Studio > Integration> Connectors > Create REST Integration Wizard.
  2. Provide the endpoint URL of the sample XML to be imported.
  3. Select Get Method.
  4. Use override option to add the query string and header parameters.
  5. Mention Resource name as any name that matches with one of the complex nodes within the sample XML.
  6. Go to next step and click on Add a REST response. Pass the values for header and query string parameters as needed.
  7. Click next to go to Step# 4 and generate the rules.
  8. Run the generated Parse-XML rule and try to parse the XML response by selecting "Text to be parsed" option. We can see that the values for elements that has type associated with it are not parsed as shown in below example:

<updatedAt>
<pxObjClass>Org1-Int-Test-UpdatedAt</pxObjClass>
<type>dateTime</type>
</updatedAt>
<id>
<pxObjClass>Org1-Int-Test-Id</pxObjClass>
<type>integer</type>
</id>
<createdAt>
<pxObjClass>Org1-Int-Test-CreatedAt</pxObjClass>
<type>dateTime</type>
</createdAt>


Root Cause



A defect in Pegasystems’ code or rules is identified as root cause of this issue.

Resolution



Apply HFix-33635.

Published April 25, 2017


100% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.