Message Layer Context Variables
Message Layer Context Variables
gateway83
The following table lists the predefined context variables related to the message layer.
The variables in the following table are valid only for SOAP web services. They do not apply to XML applications.
Variable | Description |
---|---|
${ <target >.buffer.status} | Returns one of the following strings:
|
${ <target >.contentType} | Content-Type the API Gateway is using for the specified message; this may be a transport-specific default. Unlike the Content-Type HTTP header, this value is guaranteed to be present and non-empty for any message in the API Gateway . This will always start with "multipart/" if the message has attachments. |
${ <targe t>.mainpart} | Returns the body of the main/root MIME part, including any attachments; turns the message into a String. |
${ <target >.mainPart.contentType} | Content-Type the API Gateway is using for the specified message's first part; this may be a transport-specific default. Unlike the Content-Type HTTP header, this value is guaranteed to be present and non-empty for any message in the API Gateway . This will typically be the same as ${foo.contentType} unless the message has attachments. |
${ <target >.mainpart.size} | Returns the actual size of the first (XML) part of the message in bytes, not including attachments. |
${ <target >.originalmainpart} | Body of the main/root MIME part before any modifications made by the API Gateway through DOM (such as WSS Processor decryption of encrypted elements). This is only available if the audit.originalMainPart.enable cluster property is set to "true". |
${ <target >.parts.1} | Returns the content of the main/root MIME part of the message, if it is accessible as binary data. |
${ <target >.parts.1.body} | Returns the content of the main/root MIME part of the message, if it is accessible as text. |
${ <target >.parts.1.contentType} | Returns the full Content-Type of the main/root MIME part of the message. |
${ <target> .parts.1.header.<name>} | Returns the main/root MIME part of the header values (for example, "header.content-id"). |
${ <target >.parts.1.size} | Returns the size of the main/root MIME part in bytes. |
${ <target >.parts.X} | Returns the content of the Xth MIME part of the message, if it is accessible as binary data. (1) This built-in variable can be used as a multivalued context variable, with the "X" reference used in the same manner as the "[0]" indexing option. This allows you to use the variable with a Run Assertions for Each Item assertion to parse a request for a specific value. (2) When using this variable in the Run Assertions for Each Item assertion, do not include the "X" in the variable name—for example, enter "request.parts" in the "Name of Existing Multivalued Variable" field, not "request.parts.X". |
${ <target >.parts.X.body} | Returns the content of the Xth MIME part of the message, if it is accessible as text. |
${ <target >.parts.X.contentType} | Returns the full Content-Type of the Xth MIME part of the message. |
${ <target >.parts.X.header.<name>} | Returns the Xth MIME part of the header values (for example, "header.content-id"). |
${ <target >.parts.X.size} | Returns the size of the Xth MIME part in bytes. |
${ <target >.size} | Actual size of the entire message, including all attachments. Ignores Content-Length headers. |
${request.listener.concurrency} | For inbound HTTP and HTTPS requests, this returns the number of request threads active within the thread pool that is handling the current request, at the time the current request was dispatched to a handler thread. |
${request.soap.envelopeNs} | Returns the namespace of the SOAP envelope in the request. Possible values include:
|
${request.soap.version} | Returns the SOAP version in the request. Possible values include: 1.1, 1.2, or null (""). |
${request.soap.namespace} | Returns the value of the SOAP payload namespace URI. |
${request.soap.operation} | Returns the name of the SOAP operation. |
${response.cookie.overwriteDomain} | Controls whether cookie domains will be overwritten. Value is a Boolean.
(1) Set this variable prior to routing. This variable has no effect if there is no cookie in the context. (2) In some reverse proxy scenarios, this variable may need to be set to 'false'. (3) Do not set this variable within an encapsulated assertion, as values do not carry over to the parent policy. |
${response.cookie.overwritePath} | Controls whether the cookie paths are overwritten. Value is a Boolean.
Example of null path: Consider the HTTP routing to http://host/example/test.jsp. If "test.jsp" returns a null cookie path, then if ${response.cookie.overwritePath} is set to "false", the cookie path that will be returned from the API Gateway will be "/example".(1) It is recommended that this variable be set prior to routing. This variable has no effect if there is no cookie in the context. (2) In some reverse proxy scenarios, this variable may need to be set to 'false'. (3) Do not set this variable within an encapsulated assertion, as values do not carry over to the parent policy. |
${response.soap.envelopeNs} | Returns the namespace of the SOAP envelope in the response. Possible values include: http://schemas.xmlsoap.org/soap/envelope/ http://www.w3.org/2003/05/soap-envelope null ("") |
${response.soap.version} | Returns the SOAP version in the response. Possible values include: 1.1, 1.2, or null (""). |