You can define several responses for an operation in your virtual service. The Dispatch Style setting of an operation specifies which response the virtual service returns in this or that case:
The following dispatch types are available:
Dispatch Type | Description |
---|---|
Sequence | Returns responses in series. |
Random | Returns a response selected randomly. |
Query Match | Selects a response based on the data of the incoming request. |
XPath | Selects a response by retrieving data from the incoming request with an XPath expression. |
Script | Selects a response by running a script code. |
Conditional Match | Selects a response by pairing specific requests with specific responses. |
Parameter | Selects a response by analyzing parameters of the incoming request. Available for REST virtual services only. |
Notes
-
Virtual services can support a limited set of dispatch types:
Sequence Random Script Query Match XPath Conditional Match Parameter JDBC TCP -
The dispatch strategies are mutually exclusive and cannot be combined. If you need an advanced response selector, use the Script or Conditional Match dispatch type.