Imported from previous forum
Hi all, this may sound like a bit obvious but I am frankly confused in this:
What marks the ending of a Header and starting of the body. Similarly what marks the completion of a message body and start of the trailer? From what I know, the fields within the body are separated by a <SOH> delimeter. Therefore, the structure of a Heartbeat fix message may look like following. Please correct me if I am wrong.
8=FIX4.1<SOH>9=45<SOH>35=0<SOH>49=s<SOH>56=r<SOH>34=5<SOH>52=10:03:03<SOH>10=175
The checkSum is not accurate, I just typed it.
btw: how do I write the <SOH> character? I have seen the decimal and hexa decimal values for SOH are 001 and 01. What I wanted to know is what do I write in the packet as the whole packet may be written in a String? do I write <001> with or without pointed braces? or do I write the hexadecimal <01> with or without pointed braces to represent the SOH? or do I write the Alt+001? Any help is highly appreciated.
Where does the counting for the bodylength starts?
-
The SOH character delimits field/value pairs. There is no special header vs. body vs. trailer delimiter, however, certain fields are designated to be part of the header or trailer. Also certain fields must be at the beginning or end of the message. Your Heartbeat example would be more accurate as:
8=FIX4.1<SOH>9=45<SOH>35=0<SOH>49=s<SOH>56=r<SOH>34=5<SOH>52=2004-01-13-10:03:03<SOH>10=175<SOH>
– I changed the format of your SendingTime field (52) from "52=10:03:03" to "52=20040113-10:03:03"
– I added the missing <SOH> after the last (Checksum) field -
The SOH character is a “character”, not string. It is an unprintable character which is why you see human-readable examples with notations such as “<SOH>” or “|”. It is a single character of ASCII decimal value of 1, just like the “null character” (’\0’ in C language) is a single character with an ASCII decimal value of 0 or the “uppercase A” character is a single character with an ASCII decimal value of 65. Alt-001 (via numeric keypad) does generate that charcter on a Windows machine.
-
Please review the FIX Specification (Volume 2 in FIX 4.3+) "Data Integrity" which states: The message length is indicated in the BodyLength field and is verified by counting the number of characters in the message following the BodyLength field up to, and including, the delimiter immediately preceding the CheckSum tag (“10=”)
> Hi all, this may sound like a bit obvious but I am frankly confused in this:
>
> 1)
> What marks the ending of a Header and starting of the body. Similarly what marks the completion of a message body and start of the trailer? From what I know, the fields within the body are separated by a <SOH> delimeter. Therefore, the structure of a Heartbeat fix message may look like following. Please correct me if I am wrong.
>
> 8=FIX4.1<SOH>9=45<SOH>35=0<SOH>49=s<SOH>56=r<SOH>34=5<SOH>52=10:03:03<SOH>10=175
>
> The checkSum is not accurate, I just typed it.
>
> 2)
> btw: how do I write the <SOH> character? I have seen the decimal and hexa decimal values for SOH are 001 and 01. What I wanted to know is what do I write in the packet as the whole packet may be written in a String? do I write <001> with or without pointed braces? or do I write the hexadecimal <01> with or without pointed braces to represent the SOH? or do I write the Alt+001? Any help is highly appreciated.
>
> 3)
> Where does the counting for the bodylength starts?
>