I am receiving XML files containing multiple "documents". I want to split the whole XML into documents and then process each document.
<?xml version="1.0" encoding="UTF-8"?>
When I understand the documentation of the the "Run Assertions for Each Item Assertion" correct, I can run into problems when I use it:
If any of the POST requests fail to reach the target server, the Run Assertions for Each Item assertion will fail and the remaining POSTS will not be attempted.
I understand this as: the iteration can break after 2 documents. What happens then to the rest of the documents? How can I process them since the iteration will always break at the same point no matter how often I retry?
What I am looking for is way to process EACH document, no matter if one or some documents are not processable. If a processing error occurs, I would like to define an "exception handling" for the erroneous document. But the iteration must continue.
Thanks for any hints
To provide the answer to my own question: the "Handle errors" assertion is your friend when you want to do this. Combined with the "Raise error" assertion to abort the current cycle, but not the iteration itself.
This example produces the following log output:
I’ve attached a policy to this email showing you a basic run through of this scenario. I created the request message within the policy that looks like this:
CA API Management Community: https://communities.ca.com/community/ca-api-management-community