Reference - XML/Soap Parameters and Responses
Populating XML/Soap posts and parsing XML/Soap responses both use a similar syntax
for referencing parts of the XML. This article explains that syntax.
For the first part of this discussion we will use this example XML posting template:
Since most of the values in this XML are children of the "person" node, the best XML posting root for
this example would be "request.person". Then you could reference the "ssn" node by using the parameter
name ".ssn" and the "postalcode" node by using the parameter name ".address.postalcode". If you use that
posting root, you can reference the "affiliateid" node by using the absolute path (without a leading "."
on the name) "request.affiliateid".
Sometimes, lead buyers use attributes instead of node names to distinguish different values in the XML. In the
bit of XML below, "ssn" is the value of a "name" attribute of a "data" node:
To reference "ssn" in the above node with an attribute in TSL PingTree, you use this syntax:
Note that in this example you CAN NOT set the posting root to "request.data" because you can
not start a relative path with a "!" attribute delimiter. So for this example you could set
the posting root to "request" and then you could reference "ssn" by using the parameter name
You can also have multiple attributes in a path. For example, given this XML:
<subdata name="street">Main Street</subdata>
You can reference the postal code buy using the path:
Repeating XML Elements
You may need to populate values in a list of repeating elements. For example, given this XML:
You can access the amount of the first income using either of these paths:
If you leave off the instance number then "(0)" is assumed. You can reference
the amount of the second income using this path:
When populating repeating XML elements, the element must be present in the XML posting template.
If you try to populate "request.incomes.income(5).amount" but that element doesn't exist in the template,
you will get a configuration error.
In very rare instances, you may run into a really odd response type where a system responds with XML inside of XML. There
is no good reason for doing this--it's usually the result of a junior level programmer implementing the system. TSL Ping
Tree can parse this response type as long as all of the XML is properly formed and escaped. That response might look like this:
<?xml version="1.0" encoding="utf-8"?>
The inner XML for this response is contained in the node soap:Envelope.soap:Body.PostApplication_V2Response.PostApplication_V2Result and
looks like this when decoded:
To access the item "Status" in the inner XML of this response use this syntax:
The ">" character at the beginning of the node signifies this node contains encoded XML.
When an interface returns this type of response, the XML may NOT be properly encoded. A possible issue when this type of
response is being returned is that the junior programmer forgot to properly encode the "&" character. If they did that,
TSL Ping Tree currently CAN NOT parse that response.