XML APIs
-
- UpdatedJun 5, 2025
- 4 minutes to read
- Yokohama
- Edge Encryption
XML APIs can be used after calling getAsXmlContent() on either the request object or a ParameterValue property.
- Call getAsXmlContent() on the request object or ParameterValue property. This returns an iterable object of the XMLContent underlying class.
- Call getIterator() or getIterator(String xPath) on the XMLContent object. This returns an XMLElementIterator object that can be used to iterate over XML elements.
- Call the hasNext() method on the XMLElementIterator object to determine whether another element is available.
- Call next() on the XMLElementIterator object to return the next XML element. You cannot call next() without first calling hasNext().
- Call valueFor(String tableName, String fieldName) on the
XML element. This method tells the proxy that the value for this element
maps to the specified field in the specified table. The proxy then checks if
the field must be encrypted.Note: To determine if you want to call valueFor(String tableName, String fieldName) on an XML element, you can use the getName() method to return the name of the element.
Mapping to a known table-field on the instance
In this example, the XML payload will be processed on the instance to insert records in the incident table. The description field will populate short_description on the incident.
The following encryption rule action can apply:
This action iterates through the description tags and asks the proxy server to encrypt the values and insert them into incident.short_description on the instance.
Mapping to an unknown table-field on the instance
In this example, the rule iterates over the record tags, but does not know what tags to expect within the record tag. The only known is that the tags within the record tags match the names of the columns specified in the table URL parameter.
The rule also specifies that, if the table is incident, then the data in the description tag should be encrypted and stored in the short_description field on the instance.
In the encryptFieldsInRecord() function, the valueFor() method is called on a table and a field that are dynamically assigned based on the request. Even though the table and field names can change, the rule asks the proxy to check whether the field in the table must be encrypted based on the encryption configurations defined.
If the field is not configured for encryption, or if the tag does not match a field in the table, the proxy skips that tag. If the tag matches a field marked for encryption, then the Edge Encryption proxy server encrypts the value.
Using an encoded query
In this example, all tags have the filter attribute, which indicates whether the tag contains an encoded query.
The following encryption rule action can apply:
If the filter attribute value is true, the rule asks the proxy server to encrypt the values in the encoded query. If false, the rule asks the proxy to check whether the field should be encrypted.