Developer

HTTP Request Response Mapping

The request response definition maps a data value returned from the process called by the HTTP request to a value within the mobile application.

The response mapping definition is a child to an HTTP request definition. This value may be extracted from structured XML using XPaths or XSL. It may also be a Cookie value or the HTTP Header.

For a complex table the values may be mapped to the fields in a complex table record, an error message, the last update value to be compared against the complex 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 one of 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 value 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 complex table:
    • Complex Table Field: This is the default selection and will result in the value being mapped to the selected complex table field in the table records. This enables the field Field Name, where the complex table field to which the return value is mapped.
    • Error Message: This selection will map the data to error text display by the mobile application.
    • Last Update: This selection specifies the extracted value is a date and time indicating when the complex table’s source in the back end system was last modified. This value is mapped to each record. However, the latest date and time value for all records is the one stored with the complex table on the 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 the value extracted by the response mapping. When selected, the attribute String Name will be available to name the local data tag created. 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.
    • 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 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.
  • Field Name: This attribute is available when the map type is set to Complex Table Field. This attribute specifies the complex table field to which the values extracted by the mapping is assigned in the complex table records.
  • String Value: This attribute is available when the map type is set to Local String or 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.