This sample provides two alternative testing methods:
A plugin for the Toolkit, which provides a graphical TCPIP Test View which sends and receives TCPIP socket data. This is described in detail in the section
Using the TCPIP Test View
An application, ISO8583TestApplication is provided which uses a message flow to transform
between MQ messages and TCPIP socket data. This is described in detail in the section
Using the ISO8583TestApplication
Both approaches provide two tests (one for data flowing in each direction) and they also
assume that the Default Configuration has been created.
Instructions are provided in the IBM Integration Bus documentation for
Creating the Default Configuration.
This sample provides a TCPIP Test View for the IBM Integration Toolkit. To
install this plugin, in the Toolkit select the menu option Help -> Install New Software. You will be prompted to
select an install site. Use the Add button to Add a Local Repository and in the pop-up
dialogue specify the local TCPIP_Tester_Update project which was placed in your workspace when installing the sample.
Assuming your workspace is at C:\workspace, the dialogue will look like this:
Click OK, and you will be returned to the Install wizard. Select the feature:
Click Next, and the Install Details page will appear:
Click Finish. You may be prompted to restart the Toolkit, but in most cases this should not be necessary (select Apply Changes Now).
To check the plugin was installed correctly, select the menu option Window -> Show View -> Other, and from the pop-up
dialogue, choose TCPIP, as shown below:
If the view is not available, then restart the Toolkit using the -clean option.
Deploy the sample application ISO8583Application.
If you have already been testing using ISO8583TestApplication, make sure you have deleted this application from the
Execution Group before continuing any further. You should not try connecting the TCPIP Test View to the socket as well!)
You are now ready to run the sample.
Test ISO8583 to XML
If you have not already done so, launch the TCPIP Test View from the menu Window -> Show View.
By default the Hostname property (which specifies the hostname or IP address of the IBM Integration Bus
installation on which the ISO8583Application is deployed) is populated with the value localhost. By default the
Port property (which specifies the port used by the message flows ISO8583_TCPIP_to_WMQ and ISO8583_WMQ_to_TCPIP) is populated
with the value 1111. You can change these values if you wish, but they must match the properties of the deployed message flows.
Click the Browse button and navigate to the test data file Test_ISO8583_to_XML.txt. This test file is located
in the ISO8583Application which the sample imports into the Toolkit workspace.
Click the TCPIP Connect button. The console window at the base of the TCPIP Test View should report that the connection
to the message flow has been made successfully:
2012/07/05 13:02:17 TCPIP Connect: A socket connection has been created to host localhost, port number 1111
You should see that the Hostname and Port fields have been disabled. They will remain this way until the connection
is closed later.
Click the TCPIP Send button. The Test View should send the data from the nominated file to the socket on which
the message flow is listening. The console window at the base of the TCPIP Test View should report that the data has
been sent successfully:
2012/07/05 13:02:33 TCPIP Send: Output data written to the socket was taken from the file C:\workspace\ISO8583TestApplication\Test_ISO8583_to_XML.txt
2012/07/05 13:02:33 TCPIP Send: <DATA SHOWN HERE>
Click the TCPIP Disconnect button. Note that the configuration of the sample message flow is such that
it will not read in the data until the the socket has been closed. The console window at the base of the TCPIP Test View should report that
the connection has been closed successfully:
2012/07/05 13:02:43 TCPIP Disconnect: The socket connection to host localhost, port number 1111 has been closed.
Use the IBM Integration Toolkit test client tool to read the corresponding output message which should
be in XML format on the output queue named ISO8583.OUT. Open the flow test file ISO8583_TCPIP_to_WMQ_Dequeue.mbtest which is located in
the ISO8583Application project. Click the Get Message button. The expected output message from the output
queue (ISO8583.OUT) should be in XML format and is shown in the section Expected Output Messages.
The image below shows the TCPIP Test View console when testing ISO8583 to XML:
Test XML to ISO8583
Launch the TCPIP Test View. By default the Hostname property (which specifies the hostname or IP address of the IBM Integration Bus
installation on which the ISO8583Application is deployed) is populated with the value localhost. By default the
Port property (which specifies the port used by the message flows ISO8583_TCPIP_to_WMQ and ISO8583_WMQ_to_TCPIP) is populated
with the value 1111. You can change these values if you wish, but they must match the properties of the deployed message flows.
Click the TCPIP Connect button. The console window at the base of the TCPIP Test View should report that the connection
to the message flow has been made successfully:
2012/07/05 13:12:02 TCPIP Connect: A socket connection has been created to host localhost, port number 1111
You should see that the Hostname and Port fields have been disabled. They will remain this way until the connection
is closed later.
An example XML input message is provided in the file Test_XML_to_ISO8583.txt. This test file is located
in the ISO8583Application which the sample imports into the Toolkit workspace. Use the IBM Integration
Toolkit test client tool to write this message to the input queue of the
message flow ISO8583_WMQ_to_TCPIP which is named ISO8583.IN. Open the flow test file ISO8583_WMQ_to_TCPIP_Enqueue.mbtest
which is located in the ISO8583Application project. Click the Put Message button.
Back in the TCPIP Test View, click the TCPIP Receive button. The Test View should receive the data from the
socket to which it was sent by the message flow. The console window at the base of the TCPIP Test View should
report that the data has been received successfully:
2012/07/05 13:12:22 TCPIP Receive: Input data has been read from the socket: <DATA SHOWN HERE>
Click the TCPIP Disconnect button. The console window at the base of the TCPIP Test View should report that
the connection has been closed successfully:
2012/07/05 13:12:25 TCPIP Disconnect: The socket connection to host localhost, port number 1111 has been closed.
The image below shows the TCPIP Test View console when testing XML to ISO8583:
If you imported and deployed the sample using the link in the ISO8583 Sample Overview
then the required MQ queues will have been created for you and the ISO8583Application will have been deployed.
Alternatively if you have not done this and just imported the projects into your workspace, then create the queues (ISO8583.IN,
ISO8583.OUT, ISO8583.TESTER.IN, ISO8583.TESTER.OUT) and deploy ISO8583Application manually yourself now.
This method of testing also requires you to manually deploy the test application ISO8583TestApplication. Do this now.
The test application contains a very simple message flow which mediates data between messages and TCPIP socket connections:
Test ISO8583 to XML
Start the IBM Integration Toolkit's built-in test client by opening the flow test file SendTCPIP_with_ISO8583TestTool.mbtest
which is located in the ISO8583TestApplication project. This test is set up to read the example ISO8583 data
from the file named Test_ISO8583_to_XML.txt (in project ISO8583Application) and write it to the input queue (ISO8583.TESTER.IN)
of the test flow. Click the Send Message button in the test client to put the message to the queue.
The message flow ISO8583TestTool will simply read the message and send it to the input TCPIP socket of the main
message flow ISO8583_TCPIP_to_WMQ. The ISO8583_TCPIP_to_WMQ message flow will parse the ISO8583 message using the provided
DFDL model, remove the PrimaryBitmap and SecondaryBitmap (which are not needed in the XML output message), and transform the
data to an output XML message which is written to the output queue ISO8583.OUT. Read this corresponding output message using
the IBM Integration Toolkit test client tool. Open the flow test file ISO8583_TCPIP_to_WMQ_Dequeue.mbtest which is located in
the ISO8583Application project. Click the Get Message button. The expected output message from the output
queue (ISO8583.OUT) should be in XML format and is shown in the section Expected Output Messages.
Test XML to ISO8583
Start the IBM Integration Toolkit's built-in test client by opening the flow test file ISO8583_WMQ_to_TCPIP_Enqueue.mbtest
which is located in the ISO8583Application project. This test is set up to read the example XML data
from the file named Test_XML_to_ISO8583.txt (in project ISO8583Application) and write it to the input queue (ISO8583.IN)
of the main flow. Click the Send Message button in the test client to put the message to the queue.
The message flow ISO8583_WMQ_to_TCPIP will parse the XML, analyse the fields it contains and construct the
PrimaryBitmap and SecondaryBitmap accordingly. The flow will then send the ISO8583 format message to the output socket
which will be received by the testing flow ISO8583TestTool. This data will be written to the output queue
ISO8583.TESTER.OUT. Read this output message using the IBM Integration Toolkit test client tool. Open the flow test
file ReceiveTCPIP_with_ISO8583TestTool.mbtest which is located in the ISO8583TestApplication project.
Click the Get Message button. The expected output message from the output queue (ISO8583.TESTER.OUT) should be in
ISO8583 format and is shown in the section Expected Output Messages.