RIT - http
IBM.com Documentation developerWorks Getting Started

Standard Setup

This example is based on the supplied ADDNUMBERS client server. The code can be found in D:\Program Files\IBM\RationalIntegrationTester\examples.

Figure: The Add Numbers server.

Start the server.

Figure: The Add Numbers client.

Make note that the wsdl-file is available at:

http://localhost:8088/addNumbers?wsdl
so you could paste the wsdl-url in the Logical View using Ctrl-V.

The client can send it's SOAP messages directly to the server.

Two options to intercept

There are two options to intercept the messages.

When a setup is done, any RIT actions like recording and/or development is the same.

Option 1: Add Proxy definition in Client

With this option we leverage that the client can sent it's communication via a proxy. This is often done via argumnet starting the client (/or settings).

Change Starting Client

If you start the client with a reference to the proxy no additional configuration is needed in RIT.

@rem ***************************************************************************
@rem Licensed Materials - Property of IBM
@rem (c) Copyright IBM Corporation 2013. All Rights Reserved.
@rem
@rem Note to U.S. Government Users Restricted Rights:
@rem Use, duplication or disclosure restricted by GSA ADP Schedule
@rem Contract with IBM Corp.
@rem ***************************************************************************
@echo off
pushd
setlocal
title Add Numbers Client

set JAVA_HOME=..\..\jre\
set SSL_PROPS=-Djavax.net.ssl.trustStore=addNumbersClient.jks -Djavax.net.ssl.trustStorePassword=secret -Djavax.net.ssl.keyStore=addNumbersClient.jks -Djavax.net.ssl.keyStorePassword=secret
set NET_PROPS=-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Address=false

@rem %JAVA_HOME%\bin\java %NET_PROPS% %SSL_PROPS% -jar AddNumbersClient.jar

@rem Below are options for connecting to a proxy on the localhost.  Comment out the previous line and remove the comment from this line to use it.
@rem If the proxy is located elsewhere on the network, you will need to update the command line options appropriately.
%JAVA_HOME%\bin\java %NET_PROPS% %SSL_PROPS% -Dhttp.proxyHost=proxyserver -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts=  -jar AddNumbersClient.jar

endlocal
popd

Activating the proxy results in an http header entry

httpHeaders
    host     targetserver:8088

The message will be send to the proxyserver:3128. The proxyserver will forward the message to the targetserver:8088.

Update Physical Defintion

Now we can test our own stub.

Option 2: Add RIT Rule to Proxy

In this case the client is not changed. It sends it's messages to a machine on a port. If we change this definition to point directly to the proxy and a defined port. The newly created rule will forward to the actual service. (the proxy+service is now seen as the 'service' by the requester)

Agent Setup

In the D:\Program Files\IBM\RIT-Platform\httptcp\registration.xml a new line is added:

<!--
	<forward bind="192.168.10.10:2000" destination="example.com:3000" />
	<forward bind="0.0.0.0:2001" destination="example.com:3001" type="fix" />
	<forward bind="localhost:2002" destination="example.com:3002" type="tcps" />
-->
<forward bind="localhost:3033" destination="localhost:8088" type="http" />

This means that any http-messages entered on localhost:3033 will be forwarded to localhost:8088. See the README.txt.

Note! Please check you are using the right type - for addNumbers SOAP message it is http. (type="tcp" will work too)

Make note that you need to restart the Agent process to include the change.

Communicate via Proxy

Now we can redirect the client to the proxy.

Figure: Redirect the client to the proxy.

Now we are ready for recording messages.

Recording Message

In the logical view we add a AddNumberServer

Figure: AddNumberServer

It's bound to a fysical

Figure: Binding for the AddNumberServer in the Test environment

Now we can record messages on the communication (via the proxy....).

Figure: Recording.

Based on these recordings one can create tests and stubs in the usual way, which is protocol independant.

We saw that the Proxy had an UnkownHostException for tbd.company.nl.
It could not look up the IP address for the host as it does not exist yet.
Adding a dummy address, pointing to a live system, in the Proxy system's hosts file resolved the issue.

After speaking to the Dev team it turns out that this should work if a stub is handling this host's traffic.
The Fix List shows that it was fixed in 8.6.0.2

Starting Scripts Linux - Proxy Restart

There are some starting script supplied for Linux. At the restart a 1 second sleep is in between. I experienced that this is a bit short for 'virtualized/cloud based' implementations. Preferably this should be somewhat longer like:

restart)
	stop
	# Sleep for 5 seconds
	# For fast responding systems this might be shorter.
	echo $"Sleep for 5 seconds."
	sleep 5
	start
	;;

When the starting is to fast after the stop, the IP ports might still be in use by the dying processes. Check the RIT Proxy logs.

http 1.0, http 1.1, http 2.0

Tip! A higher release level can result in a major performance improvement!

Some customer experience shows that a mismatch between the sending and requesting http can cause unwanted delays resulting in bad performing stubs. E.g. the stub is talking 1.0 and the requester in 1.1.

Best is to have matching levels of http. If you don't know some guidance can be:

http 2.0 is supported as of RIT 901.

Certificates and Public/Private Keys

Introduction:

Certificates for Dummies

PKI - public key infrastructure.

SSK RIT - Part1
SSK RIT - Part2

Other sources