Sequential Rewrite Write Response¶
When a webservice creates or updates data, it typically replies with the fully populated record. Sequential rewriting assumes the response is in the same order as the data that was sent.
The XML Writer rewrites sequentially in the same way, with XPath in place of JPath and namespaces to declare.
IMan walks the response in step with the IMan data: from the top-most node inwards to the children, then back out and on to the next record.
Where the service does not guarantee that order, use Keyed Rewrite instead. If the response has been re-ordered, matching by position writes each record's values onto the wrong record, and IMan reports no error.
Configuring the response¶
IMan parses the response using JPath. You configure it the way you configure a JSON Reader: an Initial Path, a Transaction Path per transaction and a Field Path per field.
Initial Path¶
The path to the first array, or repeating set of nodes, in the response.
Set it with Initial Return JPath on the writer's Field Mapping tab. The field appears only while a Sequential or Keyed rewrite is selected.
Transaction Path¶
The path to the array, or repeating set of nodes, holding this transaction's records. It is relative to the parent transaction's path, or to the Initial Path for the top-most transaction.
Set it with Transaction Type Return JPath, per transaction.
IMan matches records to the response in the order the elements appear in it: the first element to the first record, and so on.
A short response updates only the records it covers
Where the service returns fewer elements than were sent, IMan updates only the first n records, where n is the number of elements in the response. The remaining records keep the values they had, and the run does not fail.
So IMan does not report a partial response as an error. Where that matters, check downstream whether a rewritten field is empty. Do not assume every record came back.
Response Field Path¶
The path to the property in the response holding this field's value, relative to the Transaction Path. Set it with Response JPath in each field's dialog.
IMan writes back only to fields with a populated Response JPath. A field left blank keeps the value it went out with.
The grid's Response JPath column shows the same value. Like the control itself, it appears only under a Sequential or Keyed rewrite on an http(s) target.
Is Relative Response JPath¶
Whether IMan reads the Response JPath relative to the Transaction Path, or as an absolute path from the root of the response.
It is ticked by default, which suits most cases: the path is relative to the node the Transaction Path found. Untick it to read a value from elsewhere in the response, such as a status or a batch reference that sits above the records instead of inside them.
The XML Writer has the same control, named for XPath.

