Services
Use service properties in your simulation file to define the order in which your virtual service sends and receives messages.
This topic lists all services properties and includes an example that shows how to use them.
|
Services property |
Description |
Example |
|---|---|---|
|
description |
Optional description of the service. |
myDescription |
|
Name of the service. |
myService01 |
|
|
steps |
Defines the steps that the virtual service runs. Depending on the type of virtual service, you need two or more steps. For example, a request response pair has an incoming step followed by an outgoing step. A contract has an outgoing step followed by an incoming step. For a scenario, define several steps to simulate messages in a specific order. |
This example shows a virtual service with the following properties:
-
The virtual service Service01 is a request response pair.
-
The inbound step trigger waits for a message with a uri property that contains any value. If an incoming message meets this condition, API simulation sends a response.
-
The outbound property message sends the value Hello world! to a service with the connection port 54545.
schema: SimV1
name: default
services:
- name: Service01
steps:
- direction: In
trigger:
- uri: '*'
- direction: Out
message:
payload: Hello world!
connections:
- port: 54545