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.

127.0.0.1 client client.opencloud.co.nz
127.0.0.2 server server.opencloud.co.nz

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:

$ ./scenario-simulator.sh -l simulator-server.log -f http-examples/config/setup-server.commands
$ ./scenario-simulator.sh -l simulator-client.log -f http-examples/config/setup-client.commands

To start scenario simulator instances with TLS:

$ ./scenario-simulator.sh -l simulator-server.log -f http-examples/config/setup-server-tls.commands
$ ./scenario-simulator.sh -l simulator-client.log -f http-examples/config/setup-client-tls.commands

Examples

Example 1. get.scen

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

Example 2. redirect.scen

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

Example 3. soap.scen

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

Example 4. OneAPISMS.scen

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

Example 5. xcap.scen

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

Important

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:

127.0.0.1 client
127.0.0.2 server
-----

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.

127.0.0.1 client client.opencloud.co.nz
127.0.0.2 server server.opencloud.co.nz

2

Deploy the HTTP resource adaptor and the Ping example HTTP service.

Examples

Example 6. HTTP example

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
Example 7. HTTPS example

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'
Previous page
HTTP Scenario Pack Version 2.0.0