File transfer request message examples
Examples of the messages that we can put on the agent command queue to request that the agent create or cancel a transfer.
Create transfer request
<?xml version="1.0" encoding="UTF-8"?> <request xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.00" xsi:noNamespaceSchemaLocation="FileTransfer.xsd"> <managedTransfer> <originator> <hostName>example.com.</hostName> <userID>mqm</userID> </originator> <sourceAgent QMgr="QM_JUPITER" agent="AGENT_JUPITER"/> <destinationAgent QMgr="QM_JUPITER" agent="AGENT_JUPITER"/> <transferSet> <item checksumMethod="MD5" mode="binary"> <source disposition="leave" recursive="false"> <file>/etc/passwd</file> </source> <destination exist="overwrite" type="directory"> <file>/tmp</file> </destination> </item> </transferSet> </managedTransfer> </request>
Create transfer request - synchronous
When a user requests a blocking synchronous request, that is, they wait for the transfer to complete and receive status messages, the message placed on the command queue contains a reply element that specifies the queue that a reply message is sent to. The following example shows the message placed on the command queue used by FTEAGENT:<?xml version="1.0" encoding="UTF-8"?> <request version="4.00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FileTransfer.xsd"> <managedTransfer> <originator> <hostName>reportserver.com</hostName> <userID>USER1</userID> </originator> <sourceAgent agent="FTEAGENT" QMgr="QM1"/> <destinationAgent agent="AGENT2" QMgr="QM2"/> <reply QMGR="QM1">WMQFTE.492D0D5502770020</reply> <transferSet> <item mode="binary" checksumMethod="MD5"> <source recursive="false" disposition="leave"> <file>c:\sourcefiles\source1.doc</file> </source> <destination type="file" exist="overwrite"> <file>c:\destinationfiles\dest1.doc</file> </destination> </item> </transferSet> </managedTransfer> </request>The <reply> element is populated with the name of the command queue manager where a temporary dynamic queue has been created to receive reply about the successful (or otherwise) completion of the transfer. The name of the temporary dynamic queue is composed of two parts:
- The prefix as defined by the key dynamicQueuePrefix in the command.properties configuration file (it is WMQFTE. by default)
- The ID of the queue as generated by IBM MQ
Cancel transfer request
<?xml version="1.0" encoding="UTF-8"?> <cancel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="4.00" xsi:noNamespaceSchemaLocation="FileTransfer.xsd"> <originator> <hostName>example.com.</hostName> <userID>mqm</userID> </originator> <transfer>414D51205553322E42494E44494E47538B0F404D032C0020</transfer> <reply QMGR="QM_JUPITER">WMQFTE.4D400F8B20002007</reply> </cancel>