IBM Books [Return to Library] [Contents] [Previous Topic] [Bottom of Topic] [Next Topic] [Help]

User's Guide


Writing Web-aware applications for the MQSeries Internet Gateway

The MQSeries Internet Gateway accepts an HTML file from a Web browser and extracts the MQ specific information. This information is then repackaged into a form that can be interpreted by specially written MQ applications. The MQ application sends the reply back to the gateway in a special format which the gateway repackages into an HTML file and passes it to the browser for display.

The MQ applications that can interact with the MQSeries Internet Gateway are described as being 'Web-aware'. Web-aware MQ applications do not use any new or specific MQ calls, but they need to be written in a particular style. Data is received from the gateway in a particular format, and the return message to the gateway has a specific format. Both these formats are included in the sample programs which can be found in the '\samples' subdirectory of your installation.

dmqsamp1
Shows how to code a simple two step conversation. Browser form data is received, formatted, and sent back to the browser in a table.
The Gateway sends a message of type MQMT_REQUEST to the application to set the 'CorrelId' to a value which is defined in the file 'dmqsamp2.c' under MQCI_NEW_SESSION. MQSeries sets a unique 'MessageId' for the message.
The Gateway expects to receive a message in the reply queue specified by the keyword MQIGwReplyQueue. This message should contain a 'CorrelId' that matches the 'MessageId' set by MQSeries for the original request.
dmqsamp2
Demonstrates multiple users having multiple state conversations with MQ through the MQSeries Internet Gateway. The session is provided as a series of forms, and all the data that is entered on the browser is kept in a session control block.
To have multiple users having multiple state conversation with the Web-aware application, the concept of a SessionId is introduced. The Web-aware application responds to the first request message with a message of type MQMT_REPLY, that has the 'MessageId' of the request in its 'CorrelId' and a 'SessionId' in its 'MessageId'. The 'SessionId'' is determined by the MQSeries application.
The Gateway memorizes the 'SessionId', passes the data to the browser, and waits for a reply from the browser. When the reply is received, the Gateway sends a message of type MQMT_REPLY to the Web-aware application. This message contains the 'SessionId' in the 'CorrelId' and a new unique 'MessageId'.
Note:You should be aware that this sample does not cater for all error conditions. In particular, it does not clean up the held session information if you close a browser without using the 'exit' button to terminate a session. These conditions would need to be handled in any user written multi-session applications applications

[Return to Library] [Contents] [Previous Topic] [Top of Topic] [Next Topic] [Help]


[ Home | Order | Search | Contact IBM | Legal ]
(C) IBM Corporation 1997. 1999. All Rights Reserved