This topic provides tips for virtualizing ISO 8583 services.
ISO 8583 is a common interface by which financial transaction card originated messages may be interchanged between acquirers and card issuers.
Parasoft Virtualize can virtualize application behavior over ISO 8583 message types with a variety of message packaging configurations. Parasoft Virtualize allows the visual modeling of such messages as well as the visual configuration of correlation and dynamic response logic—including the use of data sources.
ISO 8583 messaging is supported across the built-in transports, such as HTTP or MQ. To send messages over the ISO 8583 transport, first install the ISO 8583 listener plugin, which is available for download on Parasoft Marketplace. This plugin uses the Extensibility API described in Using Custom Transports, Message Formats, and Tools for details.
If ISO 8583 messages are exchanged over HTTPS, MQ or JMS, you record them by using the related wizards. For details, see:
Recording over other transport channels is not currently supported.
Before you configure a Message Responder for ISO 8583, you need to select a suitable packager. To do this:
If a literal (text) representation of an ISO 8583 message is available, you can paste it into the Literal view of the Message Responder, then switch to the Form ISO 8583 view. If the provided message is inconsistent with the selected packager, then an error message is displayed and the conversion to the form view fails.
Alternatively, if a sample message is not available or the format is binary, then you can build the response message from scratch using the Form ISO 8583 view. This view contains separate tabs for defining the message body and the message header.
When a data source is available, field values in these tabs can be parameterized; see Parameterizing Tools with Data Source Values, Variables, and Extracted Values.
New fields can be added with the Add button. Select one or more fields (hold CTRL while selecting multiple fields) and click Remove in order to remove the selected fields. When a single field is selected, it can be dragged as well.
The order of fields when declared in any of the ISO 8583 Message views does not influence how the fields are actually sent. Fields are always sent in ascending order based on the numeric field ID. This is consistent with the ISO 8583 message specification. However, order can be a factored when scripting is used in terms of what values are initialized first. For more details, please see Scripting ISO 8583 Header Message Fields.
The following options are available in the Form ISO 8583 view:
The Header tab can be used to configure a custom binary header for the ISO 8583 message. Header fields can rearranged (with drag and drop), and new fields can be added and removed with the corresponding buttons. Select multiple fields while holding CTRL in order to remove several fields at once. The overall size shown next to the buttons is the sum of all field sizes.
The following options can be configured in the Headers tab:
When Script is selected in a value cell, you may write custom code to generate the field value. Examples of such usage is to encrypt content or generate MAC values.
The script methods will accept zero, one or two arguments.
When a single argument is declared, it references the ISOMsg object representation of the current request ISO 8583 message. The ISOMsg object will have its fields initialized up to the current field.
For example, if you are scripting the tenth field, then the ISOMsg object will set all prior 9 fields (if any) based with those field values. This is where rearranging ISO fields can make a difference—despite the fact that rearranging order does not influence the actual field order of the sent messages. When a second argument is declared, it will reference Context, which allows for accessing environment variables, data source values, etc.
For more details, see the Virtualize Extensibility API documentation. You can access documentation for the Extension framework API via the Parasoft> Help menu (look for the book titled "Parasoft Virtualize Extensibility API").
If multiple Message Responders are used, you need to configure responder correlation as follows:
You can configure the responder to use the presence (or absence) of a field ID in the incoming ISO 8583 request message as a correlation criterion.
For example, a responder with the following configuration would respond if the incoming ISO 8583 request message does NOT contain the field ID of 7.
For general details on data source correlation in Message Responders, see Data Source Correlation Tab.
Field IDs (provided for the incoming messages) can be matched with one or more data source column name (similar to how XPaths, URL parameters, etc. are handled). Form ISO 8583 fields can then be parameterized with various data source columns.
Note that Form ISO 8583 fields support the Use Data Source: Exclude with empty string feature. This allows you to generate the ISO 8583 messages with dynamic fields and have them included/excluded based on the data in the corresponding data source row. See Using Data Sources with Form XML: Excluding Elements and Attributes for details on this capability.