HTTP Request Response Mapping

The response mapping definition is a child to an HTTP request definition. This definition maps a data value returned from the process called by the HTTP request to a value within the mobile application. This value may be extracted from structured XML using XPath or XSL. It may also be a Cookie value or the HTTP Header.

For a data table the values may be mapped to the code or value fields in a data table record, an error message, the last update value to be compared against the data table’s last update, a local data tag or local XML value, or to the user ID value that may be used in place of the ID entered to log into the Agentry Client.

HTTP Request Response Mapping Attributes

The response mapping attributes are in part dependent on the selection made in the Mapping Type attribute. Those specific to a certain type are denoted in the following list.
  • Mapping Type: This attribute specifies the mapping type. This may be Cookie, HTTP Header, XPath Expression, or XML Transformation.
  • Base XPath: This attribute is only available when the Mapping Type is set to XPath Expression or XSL Transformation. This attribute is optional and should be used when returning multiple instances of the same data element in the XML content. When a Base XPath is defined for a response mapping, the same value will be set by default in the add wizard for subsequent response mappings within the same parent HTTP request definition.
  • XPath: This attribute is only available when the Mapping Type is set to XPath Expression. This attribute contains the XPath markup to extract the desired value from structured XML data returned from the HTTP Request.
  • XSL: This attribute is only available when the Mapping Type is set to XML Transformation. It contains the XSL expression to transform the XML data to be mapped to a value for the request.
  • Cookie Name: This attribute is only available when the Mapping Type is set to Cookie. It contains the name of the cookie for the response mapping.
  • Header Name: This attribute is only available when the Mapping Type is set to HTTP Header. It contains the name of the HTTP header for the response mapping.
  • Maps To: This attribute specifies where the value extracted by the response mapping is stored in the mobile application. This may be one of the following values for a data table:
    • Data Table Key: This selection specifies the value extracted by the mapping contains the key or code field value for each data table record.
    • Data Table Value: This selection specifies the value extracted by the mapping contains the value field value for each data table record.
    • Error Message: This selection will map the data to error text displayed by the mobile application.
    • Last Update: This selection specifies the extracted value is a date and time indicating when the data table’s source in the back end system was last modified. This value is compared against the internal last update value for the data table as provided by the Agentry Client.
    • Local String (<<local>>): This selection will create a local data tag available to subsequent data mappings in the same parent HTTP Request. The value of this data tag will be the value extracted by the response mapping. When selected, the attribute String Name will be available to name the new local data tag. This is the equivalent to calling the SDML function tag <<local ...>>.
    • Local XML (<<localXML>>): This selection will create a local XML data tag available to subsequent data mappings in the same parent HTTP Request. The value of this data tag will be the value extracted by the response mapping. When selected, the attribute XML Name will be available to name the new local data tag. This is the equivalent to calling the SDML function tag <<localXML ...>>.
    • User ID: This selection will map the value extracted by the response mapping to the user’s ID. This value is the equivalent to the SDML data tag <<user.id>>. If a previous response mapping in any HTTP Request processed by the Agentry Server set the user ID, setting it here will override that value. This will then be the value available for all HTTP-XML system connection processing where the data tag <<user.id>> is referenced.
  • String Value: This attribute is available when the map type is set to Local String. It contains the name of the data tag being created by the mapping. This is the name by which the data tag is referenced in subsequent references.
  • XML Name: This attribute is available the map type is set to Local XML. It contains the name of the data tag being created by the mapping. This is the name by which the data tag is referenced in subsequent references.