The HTTP scenario pack is bundled with example configuration and scenario files.
The examples may be found in the <scenario_simulator>/http-examples
directory.
The basic HTTP examples are stand-alone scenarios using the Scenario Simulator only. The HTTP Rhino examples show HTTP integrating with the Rhino TAS.
Basic HTTP Examples
Prerequisites
1 |
Add the following entries to /etc/hosts, substituting appropriate IP addresses for each simulator if they run on a remote server. In this example all simulators are running on the local host.
|
---|---|
2 |
Start separate scenario simulators for each endpoint as needed for the examples below. The examples assume the working directory is the simulator base directory, i.e. the parent directory of the one containing this file. To start scenario simulator instances without TLS:
To start scenario simulator instances with TLS:
|
Examples
A basic http GET request
-
requires client and server endpoints
-
load scenario on both endpoints: load-scenario http-examples/scenarios/get.scen
-
run session from "client" endpoint: run-session get
URL redirect
-
requires client and server endpoints
-
load scenario on both endpoints: load-scenario http-examples/scenarios/redirect.scen
-
run session from "client" endpoint: run-session redirect
SOAP GET/200 exchange
-
requires client and server endpoints
-
load scenario on both endpoints: load-scenario http-examples/scenarios/soap.scen
-
run session from "client" endpoint: run-session soap
OneAPISMS send and status query
-
requires client and server endpoints
-
load scenario on both endpoints: load-scenario http-examples/scenarios/OneAPISMS.scen
-
run session from "client" endpoint: run-session OneAPISMS
Document creation, fetch and modification
-
requires client and server endpoints
-
load scenario on both endpoints: load-scenario http-examples/scenarios/xcap.scen
-
run session from "client" endpoint: run-session xcap
For incoming http connections address to endpoint matching is based only on IP address ignoring the port. If two or more endpoints addresses resolve to the same host then simulator will consistently match incoming dialogs to only one of those endpoints. If running more than one cooperating simulator instance locally that uses http it is recommended to define each endpoint with different local loop address example:
|
HTTP Rhino examples
This page details examples of HTTP scenario integrating with Rhino, including
-
a ping scenario that uses RhinoSDK as the server, responding to GET request with the request contents
-
a pingSecure scenario that uses RhinoSDK as the server, responding to GET request with the request contents, using secure connection
Prerequisites
1 |
Add the following entries to /etc/hosts, substituting appropriate IP addresses for each simulator if they run on a remote server. In this example all simulators are running on the local host.
|
---|---|
2 |
Deploy the HTTP resource adaptor and the Ping example HTTP service. |
Examples
Start one scenario-simulator session with the command:
./scenario-simulator.sh -l client.log -f http-examples/rhino-integration/config/setup-client.commands -e 'load-scenario http-examples/rhino-integration/scenarios/ping.scen'
Run ping session with the command:
run-session ping
Copy the keystore file to rhino home dir:
cp http-examples/rhino-integration/config/http-ra.ks $RHINO_HOME/
Update configuration of the http resource adaptor on the rhino server using rhino console commands:
updateraentityconfigproperties httpra SecureListenPort 8002 KeyStore "${rhino.dir.home}/http-ra.ks" KeyStorePassword changeit deactivateraentity httpra activateraentity httpra
Start scenario-simulator session with the command:
./scenario-simulator.sh -l client.log -f http-examples/rhino-integration/config/setup-client-tls.commands -e 'load-scenario http-examples/rhino-integration/scenarios/pingSecure.scen'