Transferring binary (CWF) data from a TCP/IP server socket to a flat file
Transfer binary Custom Wire Format (CWF) data from a TCP/IP server socket to a flat file, by the use of a message set and a message flow with TCPIPServerInput and FileOutput nodes.
About this task
Scenario: A client application opens a TCP/IP socket and sends a binary (CWF) document. The end of the document is signaled by the closure of the client connection.
Instructions: The following steps describe how to write a message flow that can receive the binary document and write it to a flat file. Each message is written to a separate file, the name of which is based on the ID of the connection.
- Create a message set called Task2_MsgSet. For more information, see Message Sets: Creating a message set.
- Create a message flow called TCPIP_Task2 with
a TCPIPServerInput node
and a FileOutput node.
For more information, see Creating a message flow.
- Connect the Out terminal of the TCPIPServerInput node to the
In terminal of the FileOutput node.
- Set the following properties of the TCPIPServerInput node:
- On the Basic tab, set the Connection details property to 14142.
- On the Input Message Parsing tab,
set the following properties:
- Set the Message domain property to MRM.
- Set the Message model property to Task2_MsgSet.
- Set the Message property to Task2_MsgType.
- Set the Physical format property to Binary1.
- Set the following properties of the FileOutput node:
- On the Basic tab, set the following
- Set the Directory property to c:\temp\task2.
- Set the File name or pattern property to Task2.out.
- On the Request tab, set the Request file name property location property to $LocalEnvironment/TCPIP/Input/ConnectionDetails/Id.
- On the Basic tab, set the following properties:
- Save the message flow.
Create a project reference between the integration project and the message set project.
For more information, see Referencing resources in other libraries.