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.

Procedure

  1. Create a message set called Task2_MsgSet.
    For more information, see Message Sets: Creating a message set.
  2. Create a message flow called TCPIP_Task2 with a TCPIPServerInput node and a FileOutput node.
    For more information, see Creating a message flow.
  3. Connect the Out terminal of the TCPIPServerInput node to the In terminal of the FileOutput node.
    TCPIPServerInput node connected to a FileOutput node.
  4. Set the following properties of the TCPIPServerInput node:
    1. On the Basic tab, set the Connection details property to 14142.
    2. 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.
  5. Set the following properties of the FileOutput node:
    1. On the Basic tab, set the following properties:
      • Set the Directory property to c:\temp\task2.
      • Set the File name or pattern property to Task2.out.
    2. On the Request tab, set the Request file name property location property to $LocalEnvironment/TCPIP/Input/ConnectionDetails/Id.
  6. Save the message flow.
  7. Create a project reference between the integration project and the message set project.
    For more information, see Referencing resources in other libraries.