{{Quickfixn}} QuickFix.MessageParseError - FIX 4.4

Rao, Masthan Masthan.Rao at abglobal.com
Fri May 6 01:20:08 PDT 2016


Hi,
            I am getting the following error in "OnOutgoing" and "OnIncoming" methods while parsing FIX messages. The same code is working FIX 5.0 specification but when I am using the same code for FIX 4.4 for another client its throwing the following error. While debugging when I hit the OnOutGoing method first time the method session.GetMessage is succesffuly parsing the message "8=FIX.4.49=10135=034=249=ABMKTDATAUAT52=20160506-07:55:49.41856=xxxxxxx553=xxxxxxx554=wu7fy3kih9iL10=131".
Immediately  again I am hitting OnOutgoing message and this time I am getting message "OUT: \n 8\t(BeginString)=\t\tFIXT.1.1|\r\n9\t(BodyLength)=\t\t126|\r\n35\t(MsgType)=\t\tA|\r\n34\t(MsgSeqNum)=\t\t1|\r\n49\t(SenderCompID)=\t\xxxxx|\r\n52\t(SendingTime)=\t\t20160506-05:23:45.993|\r\n56\t(TargetCompID)=\t\xxxxxx|\r\n553\t(Username)=\t\xxxxxxxx|\r\n554\t(Password)=\t\xxxxxxxx|\r\n98\t(EncryptMethod)=\t\t0|\r\n108\t(HeartBtInt)=\t\t30|\r\n141\t(ResetSeqNumFlag)=\t\tY|\r\n1137\t(DefaultApplVerID)=\t\t9|\r\n10\t(CheckSum)=\t\t110|\r\n -(UNKNOWN Tag)=|\r\n"

Which the FIX engine is failing to parse and throwing error. Not sure where I am going wrong. Can you guys please help?

Sample code
        public void OnOutgoing(string msg)
        {
            try
            {
                Session session = Session.LookupSession(ActiveSessionID);
                ABFixMessage message = new ABFixMessage() { Message = session.GetMessage(msg) };
                Log(message.Message, msg, "OutGoing");

                if (outgoingMessageBufferBlock != null && !msg.StartsWith("OUT:") && ActiveSessionID != null)
                {
                    if (message.Message.Header.IsSetField(56) && message.Message.Header.IsSetField(49))
                        message.Source = isAcceptor ? message.Message.Header.GetField(56) : message.Message.Header.GetField(49);
                    outgoingMessageBufferBlock.Post(message);
                }
            }
            catch(Exception ex)
            {
                logger.Error("OnOutgoing", ex);
            }
        }


Errors

03:55:50,620 [11] DEBUG Fix - [OutGoing] 8=FIX.4.49=10135=034=249=ABMKTDATAUAT52=20160506-07:55:49.41856=xxxxxxx553=xxxxxxx554=wu7fy3kih9iL10=131
03:55:52,461 [11] ERROR Fix - OnOutgoing
QuickFix.MessageParseError: Could not parse message: missing or malformed tag 35 in msg: OUT:

   at QuickFix.Message.GetMsgType(String fixstring)
   at QuickFix.Message.IdentifyType(String fixstring)
   at QuickFix.Session.GetMessage(String msgStr)
   at AB.FixEngine.ABFixLogger.OnOutgoing(String msg) in c:\work\crab\branch\2016.1.0\AB.FixEngine\AB.FixEngine\ABFixLogger.cs:line 65
03:55:53,740 [11] ERROR Fix - OnIncoming
QuickFix.MessageParseError: Could not parse message: Error at position (0) while parsing msg ( session.Next : 8=FIX.4.49=13335=334=249=xxxxxx52=20160506-07:55:52.89856=xxxxxxx45=258=Tag not defined for this message type371=553372=0373=210=187) ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
   --- End of inner exception stack trace ---
   at QuickFix.Message.ExtractField(String msgstr, Int32& pos, DataDictionary sessionDD, DataDictionary appDD)
   at QuickFix.Message.ExtractBeginString(String msgstr)
   at QuickFix.Session.GetMessage(String msgStr)
   at AB.FixEngine.ABFixLogger.OnIncoming(String msg) in c:\work\crab\branch\2016.1.0\AB.FixEngine\AB.FixEngine\ABFixLogger.cs:line 45
03:55:54,925 [11] ERROR Fix - OnIncoming
QuickFix.MessageParseError: Could not parse message: missing or malformed tag 35 in msg: IN:
 8         (BeginString)=               FIX.4.4|
9          (BodyLength)=              133|
35         (MsgType)=                  3|
34         (MsgSeqNum)=             2|
49         (SenderCompID)=                     xxxxxxxxx|
52         (SendingTime)=             20160506-07:55:52.898|
56         (TargetCompID)=                       xxxxxxx|
45         (RefSeqNum)=              2|
58         (Text)=              Tag not defined for this message type|
371       (RefTagID)=                  553|
372       (RefMsgType)=             0|
373       (SessionRejectReason)=                        2|
10         (CheckSum)=                187|
-(UNKNOWN Tag)=|

   at QuickFix.Message.GetMsgType(String fixstring)
   at QuickFix.Message.IdentifyType(String fixstring)
   at QuickFix.Session.GetMessage(String msgStr)
   at AB.FixEngine.ABFixLogger.OnIncoming(String msg) in c:\work\crab\branch\2016.1.0\AB.FixEngine\AB.FixEngine\ABFixLogger.cs:line 45
............................................................................

For further important information about AllianceBernstein please click here
http://www.abglobal.com/disclaimer/email/disclaimer.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20160506/3879adb2/attachment-0001.htm>


More information about the Quickfixn mailing list