Parse Xml Rules are not working as expected
User is using Pega 7.1.9 and reported that the Parse XML rule generated after consuming the XSD fails to parse the Request XML that the Pega SOAP Service receives.
Steps to Reproduce
- Use the Connect & Metadata Wizard to consume the XSD file.
- Select "Get" as the element name and then select Class, Property and XML Parse rule type option.
- Generate the rules.
- Run the Parse XML rule and parse the provided request XML.
- Note that the request XML is not parsed by the Parse XML rule although no errors are observed in the logs.
An issue in the custom application code or rules is identified as root cause.
When the mapping mode for elements in data mapping rules is set as Standard and the elements are marked as Optional, Pega does not map the elements to clipboard unless there is a value for those elements.
But if the mapping mode is set as "Literal XML" for an optional element, Pega will take the element and in value field it will put that element as xml tag, that is, if the element has a value then Pega parse and put the element along with it's value as xml tag and if the element does not have value then it will just put the element as xml tag.
Screenshot of clipboard mapping is provided below for an element marked as optional and whose mapping mode is set as "Literal XML":
In this use case, the mapping mode for some of the optional elements was set to standard due to which the elements were getting ignored during parsing whenever it didn't have any values. The parsing logic in the application was instead expecting the elements to be parsed as xml tag in value field which was causing the failure in the application.
Perform the following local-change:
Set the mapping mode of elements in data mapping rule to Literal XML if the expectation is to parse the elements as xml tag in the value field.
0% found this useful