How the Web Gateway fits into your WebSphere MQ File Transfer Edition topology
Use the WebSphere® MQ File Transfer Edition Web Gateway to transfer files to WebSphere MQ File Transfer Edition (WMQFTE) agents and retrieve the status of transfers using an HTTP client.
Use the Web Gateway to extend an existing WebSphere MQ File Transfer Edition network to support clients that use the HTTP protocol. The Web Gateway provides a link from clients that are using the HTTP protocol into a WebSphere MQ File Transfer Edition network that already exists. Transfers that use the Web Gateway are logged throughout the transfer. For more information about the purpose of the Web Gateway, see Scenarios for the Web Gateway.

- A Java™ Platform, Enterprise Edition 5-compliant application server
- This application server hosts the Web Gateway application. HTTP requests from clients are directed to the application server, which passes the contents of the requests to the application.
- The WMQFTE Web Gateway application
- The Web Gateway application handles both file uploads and transfer
status requests.
When a file is uploaded, the Web Gateway application writes the file data to a temporary store on the file system of the system that the application is running on. The Web Gateway application then submits a file transfer request to the WMQFTE agent, which is running on the same system. For more information on this request, see File transfer request message format.
When a request for status information is received, the Web Gateway application connects to the WMQFTE database logger database (using the data access facilities provided by the application server) to retrieve the required information. The application then generates the response, which is passed to the client.
- A WMQFTE web agent
- The Web Gateway requires a WMQFTE agent installed on the same
system as the application. This web agent can be created using the fteCreateWebAgent command;
see fteCreateWebAgent (create a WebSphere MQ File Transfer Edition web agent). This agent receives
the file transfer request message described in the previous section.
The request message refers to the file or files in the temporary store.
The agent transfers the files to an existing agent in the WMQFTE network,
reading the files from the file system store. The source disposition
behavior is set to delete so that the files are removed
after the transfer successfully completes, see fteCreateTransfer for
more information.
You do not need to specially configure this agent, because the file transfer request is an ordinary message and not specific to the Web Gateway.
- The WMQFTE database logger and a supported database
- To provide status information about transfers, started using the web or by other means, the Web Gateway application must be able to query a database that contains audit information for WMQFTE activity. This database is populated by the database logger component provided with the product. Database access is provided by the data access facilities included in each application server. The database does not need to be located on the same system as the other components.
Components needed for Web Gateway scenarios
The following diagrams show the WebSphere MQ File Transfer Edition components, and other objects, that are involved in file transfer requests. All the Java Platform, Enterprise Edition (JEE) resources used in each scenario must be defined in your application server, regardless of which scenario you are using. For details of how to configure the JEE resources, see Configuring the Web Gateway.

- A JavaScript application running in the user's web browser uses functions defined by the RESTful API provided by the Web Gateway to upload a file.
- The file data is read from the file storage located on the same system as the web browser and sent using the HTTP protocol to the application server that hosts the Web Gateway application.
- The Web Gateway Java Platform, Enterprise Edition (JEE) application receives the file data as the body of an HTTP request and writes it to file storage that is accessible from both the application server and the web agent. If the Web Gateway application and web agent are on the same system, this can be a directory on the system's file system.
- The Web Gateway application sends a message to the agent queue manager to which the web agent is connected. This message contains instructions that identify both the file to move and the WebSphere MQ File Transfer Edition agent that the file data is sent to. This information is taken from the HTTP request in step 1.
- The Web Gateway JEE application sends an HTTP response to the web browser.
- The web agent receives the message that requests the transfer of the file data.
- The web agent reads the file data, which corresponds to the uploaded file from step 1.
- The web agent transfers the file data, as a sequence of messages, to the agent queue manager.
- The agent queue manager transfers the messages, which correspond to the uploaded file from step 1, across the WebSphere MQ network. This might involve exchanging the file data between further queue managers until the data arrives at the queue manager to which the agent running on the destination system is connected.
- The agent on the destination system receives the messages containing the file data and converts the data back into a file.
- The file data is written to the file storage at the destination system.
- JEE resources used in this scenario:
- A - JMS Queue Connection Factory called WMQFTEWebAgentConnectionFactory with a JNDI name of jms/WMQFTEWebAgentConnectionFactory

- The user, or a process, sends a file transfer request (in the form of a WebSphere MQ message) into the WebSphere MQ network. This request can be sent from the command line or through another WMQFTE interface. The message is addressed to the queue manager to which the agent on the source system is connected.
- The agent on the source system receives the message, which instructs it to perform a file transfer to the web agent.
- The agent reads the file from the source file system and converts it to a sequence of WebSphere MQ messages.
- The agent sends the sequence of messages to a queue manager in the WebSphere MQ network.
- The WebSphere MQ network routes the messages, which contain the file data, to the agent queue manager.
- The web agent receives the messages, which contain the file data, from the agent queue manager.
- The web agent writes the file data, as a file, to the file space storage on a file system that is accessible to the Web Gateway JEE application.
- The web agent sends a message to the agent queue manager, to inform the Web Gateway JEE application that a file has arrived.
- The Web Gateway JEE application receives the notification message sent from the web agent via the agent queue manager.
- The Web Gateway JEE application updates a database that contains information about the files that are stored in file spaces.
- The Web Gateway JEE application sends a response, which is destined for the web agent, to the agent queue manager.
- The web agent receives the response message and completes the file transfer operation.
- At some later time, a user or process makes a RESTful HTTP request to the Web Gateway JEE application, to retrieve a file from the user's file space. In this diagram the request is made by a web browser. The request can be made by any HTTP client.
- The Web Gateway JEE application receives the HTTP request, decodes it, and uses the file space information database to locate the file data.
- The Web Gateway JEE application reads the file data from the file space storage, which is located on a file system that is accessible from the Web Gateway JEE application.
- The Web Gateway JEE application sends the file data back to the web browser that requested it.
- The web browser writes the file data to the file system on the destination system.
- JEE resources used in this scenario:
- A - JMS Queue called WMQFTEWebAgentRequestQueue with a JNDI name of jms/WMQFTEWebAgentRequestQueue
- B - JMS Queue Connection Factory called WMQFTEWebAgentConnectionFactory with a JNDI name of jms/WMQFTEWebAgentConnectionFactory
- C - Activation Spec called WMQFTEActivationSpec with a JNDI name of jms/WMQFTEActivationSpec, which is configured with the connection details for the web agent's queue manager
- D - Data source called wmqfte-filespace with a JNDI name of jdbc/wmqfte-filespace
- E - JDBC Provider referenced by the data source jdbc/wmqfte-filespace

- A JavaScript application running in the user's web browser sends a RESTful HTTP request to the Web Gateway application, requesting information about a transfer.
- The Web Gateway application queries a database containing information about file transfers that have taken place in a network of WebSphere MQ File Transfer Edition agents.
- The Web Gateway application returns the result of the query to the JavaScript application.
- Activities that occur during the above steps:
- i - WebSphere MQ File Transfer Edition agents produce messages containing information about file transfers that are taking place.
- ii - The queue managers route these messages to a designated queue manager that is performing the coordination queue manager role.
- iii - The coordination queue manager is connected to the database logger component. The database logger receives a copy of each message that relates to a transfer being performed by an agent.
- iv - The database logger records the information about transfers in a transfer history database, so that it can be queried by other applications including the Web Gateway.
- JEE resources used in this scenario:
- A - Data source called wmqfte-filespace with a JNDI name of jdbc/wmqfte-database
- B - JDBC provider referenced by the data source wmqfte-database