This topic introduces CSV Message Responders and explains configuration options that are unique to this type of Message Responder.
About CSV Message Responders
CSV Message Responders are designed to send responses with a CSV / delimited message payload. This responder simplifies the use of CSV by allowing you to utilize XML. You can model your CSV response payload as an XML document; the responder then automatically converts the XML to CSV before sending the message. If the responder receives a CSV message, the responder can convert the message to XML so that you can define message correlations using XPaths or attach tools. Message Responders are protocol agnostic. The transport protocol or API to access a responder is defined in the deployment configuration of the PVA.
You can create a CSV Message Responder tool directly from the Add Responder wizards.
Since there is no schema associated with the CSV format, you would switch to Literal view, paste in your CSV message, and then switch to Form Input view to parameterize the message.
For details on configuring standard Message Responder behavior (e.g., correlations, performance profiles, etc.), see Message Responder Overview.
In addition to the standard Message Responder options, the following conversion options are available for CSV Message Responders:
- Separator - Specifies which separator is used in the CSV file.
- Quote - Specifies which quote character is used. Quotes can be used around individual values in a CSV file. They are used in cases where the value contains the separator character that is used in the file, or in cases where a quote appears in the value (if a single quote appears in the value, you would use a double quote to surround the value; if a double quote appears in the value, you would use a single quote to surround the value). If no quotes appear, you can use either single or double quotes to surround the value.
- Trim leading/trailing whitespace - Specifies whether or not to strip whitespace from the beginning and end of the value.
- First row specifies column names - Specifies whether or not to consider the first row of the CSV file as column names. If the first row specifies column names, the elements in Form XML will show the column names as the name of each value. If the first row does not specify column names, then the elements in Form XML will use "value" as the name of each value.
These options are used converting in both directions: XML -> CSV and CSV -> XML
For example, with First row specifies column names set to true, a ',' separator, and double quotes as the quote character, messages would be converted as follows.
Last,First Dafoe, Daniel "O'Hara", Maureen
<?xml version="1.0" encoding="Cp1252"?> <root> <row> <Last>Dafoe</Last> <First>Daniel</First> </row> <row> <Last>O'Hara</Last> <First>Maureen</First> </row> </root>