CentraSite Documentation : Runtime Governance with CentraSite : Using Context Variables in Virtual Services : The Predefined Context Variables
The Predefined Context Variables
You can use the predefined context variables listed below. Any context variable state defined during the inbound request processing steps will still be available during the outbound response processing steps.
Note:  
Keep the following points in mind:
*To set, get or remove the predefined context variables, use The API for Context Variables provided by Mediator.
*You do not need to declare the predefined context variables. If you attempt to declare an existing predefined context variable, an error will occur.
Context Variable                         Display Name and Variable Name
Description
Average Response
AVG_SUCCESS_TIME
The average amount of time it took the service to complete all invocations in the current interval. This is measured from the moment Mediator receives the request until the moment it returns the response to the caller.
Note:  
By default, Average Response Time does not include metrics for failed invocations. You can include metrics for failed invocations by setting the pg.PgMetricsFormatter.includeFaults parameter to true. For details about advanced settings, see Administering webMethods Mediator.
Client IP Address
INBOUND_IP
The IP address used to send the request to Mediator.
Consumer
CONSUMER_APPLICATION
The name of the consumer application accessing the service, if known.
Fault Count
INTERVAL_FAULT_COUNT
The number of service faults for the interval.
Inbound Content Type
MESSAGE_TYPE
A Content-Type defined in axis2.xml for a message formatter. This value must be a key in the axis2 message formatters list, since it is used to control message serialization. (The valid choices are defined as attributes of <messageFormatters/> group in the Integration Server's axis2.xml configuration.)
Inbound HTTP Method
INBOUND_HTTP_METHOD
The HTTP method used by the client to send the request (GET, POST, PUT, DELETE, Use Context Variable).
Inbound Protocol
INBOUND_PROTOCOL
The protocol (HTTP or HTTPS) of the request.
Maximum Response
SLOWEST_SUCCESS_INVOKE
Maximum Response Time.
Note:  
By default, Maximum Response Time does not include metrics for failed invocations. You can include metrics for failed invocations by setting the pg.PgMetricsFormatter.includeFaults parameter to true. For details about advanced settings, see Administering webMethods Mediator.
Mediator Host Name
MEDIATOR_HOSTNAME
Mediator host name.
Mediator IP Address
MEDIATOR_IP
Mediator IP address.
Mediator Target Name
TARGET_NAME
Mediator target name.
Minimum Response
FASTEST_SUCCESS_INVOKE
Minimum Response Time.
Note:  
By default, Minimum Response Time does not include metrics for failed invocations. You can include metrics for failed invocations by setting the pg.PgMetricsFormatter.includeFaults parameter to true. For details about advanced settings, see Administering webMethods Mediator.
Outbound HTTP Method
ROUTING_METHOD
The HTTP method to be sent to the native service if the inbound HTTP method is custom. Otherwise, this value will be null. For more information, see Changing the HTTP Method of a REST or XML Request.
Success Count
INTERVAL_SUCCESS_COUNT
The number of success counts for a given service.
Total Count
INTERVAL_TOTAL_COUNT
The total number of counts for a given service.
Virtual Service Name
SERVICE_NAME
Virtual service name.
N/A
BUILDER_TYPE
A Content Type defined in axis2.xml for a message builder. This value must be a key in the axis2 message builders list, since it is used to control building of native service response messages. (The valid choices are defined as attributes of <messageBuilders/> group in the Integration Server's axis2.xml configuration.)
N/A, no display name
INBOUND_REQUEST_URI
A partial reference to a virtual service (for HTTP/HTTPS only). The protocol, host and port are not part of the value. For example, if the following virtual service is invoked:
http://mcusawco:5555/ws/TC1
then the expected value of this variable would be /ws/TC1.
For a REST or XML service, the URL might also include query string parameters. For example, if the following virtual service is invoked:
http://mcusawco:5555/ws/cars?vin=1234
the expected value of this variable would be /ws/cars?vin1234.
This is useful to know because by the time you are able to access the request inside of Mediator, the REST request would contain a top-level element that looks like this:
<vin>1234</vin>
So it is not obvious from an XSLT expression or a webMethods IS service callout what part of a REST request came in as a query parameter.
Therefore, using this variable along with INBOUND_HTTP_METHOD and INBOUND_PROTOCOL, you can determine the exact entry point URI that was used when a virtual service was invoked.
N/A, no display name
The reason returned by the native service provider in the case where it produced a SOAP fault. This will not contain Mediator errors such as security policy enforcement errors. This variable will only contain the “reason” text wrapped in a SOAP fault.
Note:  
When you are using this variable in Conditional Error Processing message that you are specifying in the Response Processing Step, note the following. If a request is denied due to security policy enforcement, the fault handler variable $ERROR_MESSAGE variable would contain a native service provider error message or other error messages that result from enforced security assertions. However, $NATIVE_PROVIDER_ERROR will be null in this case.
N/A, no display name
OPERATION
The virtual service operation selected to execute a request.
N/A, no display name
PROTOCOL_HEADERS
Contains a map of key-value pairs in the request, where the values are typed as strings. To get/set this variable, see pub.mediator.ctxvar:getContextVariable.
N/A, no display name
SOAP_HEADERS
(For use in webMethods IS services only.) Contains an array of the SOAP header elements in the request. To get/set this variable, see pub.mediator.ctxvar:getContextVariable.
N/A, no display name
USER
The value defined for the Integration Server session executing the request message. If the request is not authenticated, it will use a default unprivileged account. Otherwise, it will set the Integration Server session to the user credentials used for transport security. Also, if credentials were included for message based security (for example, an X509 token was included and this certificate was mapped to an Integration Server user), then this information would override any transport security (for example, basic authentication).
Note:  
When you use predefined context variables in a Conditional Error Processing message in The Response Processing Step (REST/XML), note the following:
*To reference a predefined context variable in a Conditional Error Processing message, you need to prepend a $ symbol to the context variable name to indicate that variable’s value should be referenced. Think of this usage as being similar to the ‘&’ address operation for C variables. A predefined context variable expression might look like this: $USER=”Administrator:”
*The $ reference symbol may appear in the text as needed. (for example, as a currency symbol). There is no escape concept used with this operator. That is, no special meaning is attached to two occurrences of this symbol: “$$”.
*If no value is defined for a valid context variable reference, the string is left unmodified for that context variable.
Copyright © 2005-2015 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback