[Quickfix-developers] Bodylength calculation with a FIX44 message including a sub-group
Brought to you by:
orenmnero
From: Bill R. Hr. <bil...@ra...> - 2004-09-22 08:53:53
|
The following message 8=FIX.4.4!9=528!35=8!49=VTX!56=XXXXX!11=M/2691122!150=B!39=B!37=7-65551-V!19 8=O/2715468!527=1000343M000027B1!336=EBS-2!625=EBS-7!453=2!448=3112!447=D!45 2=1!802=1!523=UBSZHM12!803=3!448=18207!447=D!452=11!526=O/2715468!17=1000343 M000027B1-1V-1!636=Y!1=AU!581=1!48=CH0016440353!22=4!207=XVTX!107=EMS-CHEMIE N!15=CHF!30=XVTX!54=1!151=0.000000!14=300!6=102.300000!32=300!31=102.300000! 381=30690.000000!29=1!58=CHF 30720.00;!75=20040922-10:00:17!118=30690.000000!119=30690.000000!64=20040927 -00:00:00!120=CHF!155=1.000000!156=M!60=20040922-00:00:00!10=103! triggers the exception "Invalid message: Expected BodyLength=534, Recieved BodyLength=528". Counting the length manually gives the same result, the length is 528. My application receives the FIX message from a internal system in a string and validates it with QuickFIX, e.g. FIX::Message msg(p_content, dict); Where p_content contains the message as a string. After some checking I believe that the usage a the subgroup (see following structure out of FIX44.xml) is the cause. <component name="Parties"> <group name="NoPartyIDs" required="N"> <field name="PartyID" required="N" /> <field name="PartyIDSource" required="N" /> <field name="PartyRole" required="N" /> <group name="NoPartySubIDs" required="N"> <field name="PartySubID" required="N" /> <field name="PartySubIDType" required="N" /> </group> </group> </component> The function calculateLength seems to count the length of field 802 (NoPartySubIds) twice (which results in a total length of by 6 bytes). But I'm not sure about how to fix FieldMap::calculateLength. Regards Robert PS: The message checksum doesn't compute as I changed tag 56 and replace ! mentally with \001... |