Developer

Validate User Request Response Mapping

The response mapping definition is a child to a validate user 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 XPaths or XSL. It may also be a Cookie value or the HTTP Header.

For an HTTP or OData system connection the values may be mapped to the user ID, validation, partial validation, the <<user.info>> set of SDML data tags, an error message, a local data tag, or a local XML data tag.

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:
    • User ID: This selection maps 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 SAP Mobile Platform 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.
    • Validation: This selection will map the value extracted by the response mapping to the validation structures for SAP Mobile Platform Server. This value is used to indicate if the user passed validation.
    • Partial Validation: This selection maps the value extracted by the response mapping to the validation structures for SAP Mobile Platform Server. This differs from the Validation selection in that mapping the validation result to partial validation can fail user validation with a false response, just as the validation response will, but true for Partial Validation will not fully validate the user. This is intended to provide support for validation using multiple system connections.
    • Error Message: This selection maps the data to error text display by the mobile application.
    • Local String (<<local>>): This selection creates a local data tag available to subsequent data mappings in the same parent HTTP Request. The value of this data tags 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 creates a local XML data tag available to subsequent data mappings in the same parent HTTP Request. The value of this data tag is the value extracted by the response mapping.
    • Save to User info: This selection maps the value extracted by the response mapping to the set of data tags in the <<user.info>> group. When this selection is made, you must enter a name for the data tag. Referencing these values is then accomplished via the syntax <<user.info.name>>.
  • 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.
  • With Name: This attribute is available when the map type is set to Save to User Info. 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.