<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Grant,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks for the response.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>I changed the code to follow your suggestion, so the call would use the </span>MarketDataRequest FromString()<span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>:<br>I am still getting the resulting message with tags in numerical order when I use the wired in MarketDataRequest object<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'>.var message = new QuickFix.FIX44.MarketDataRequest();<br>            QuickFix.IMessageFactory messageFactory = new QuickFix.DefaultMessageFactory();<br>            QuickFix.DataDictionary.DataDictionary dataDict = new QuickFix.DataDictionary.DataDictionary(@"M:\X4S_4.6\Config\FIXN\FIX44_ECV.xml");<br>             message.FromString(sb.ToString(), false, dataDict, dataDict, messageFactory);<o:p></o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Note that I am creating the message from a string that does not include the header, and then I am applying the header after this code snippet.<br>So what I am talking about in this code snippet is just setting the message from a string that has only the message body tags.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Any other ideas about I could do to end up with the correct tag order?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Thanks,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>Philip Clem<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Quickfixn [mailto:quickfixn-bounces@lists.quickfixn.com] <b>On Behalf Of </b>Grant Birchmeier<br><b>Sent:</b> Tuesday, February 9, 2016 12:10 PM<br><b>To:</b> Mailing list for QuickFIX/n <quickfixn@lists.quickfixn.com><br><b>Subject:</b> Re: {{Quickfixn}} Question: Creating/populating a FIX message from a string - tag order problem<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal><span style='color:black'>I see the problem.  You're calling Message's FromString method, instead of MarketDataRequest's FromString.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='color:black'>Change your first line to this:<o:p></o:p></span></p></div><blockquote style='margin-left:30.0pt;margin-right:0in'><p class=MsoNormal style='text-indent:.5in'><b><span style='font-size:11.0pt;font-family:"Courier New";color:red'>QuickFix.FIX44.MarketDataReques</span></b><b><span style='font-family:"Courier New";color:red'>t</span></b><b><span style='font-family:"Cambria Math",serif;color:red'>​</span></b><span style='font-size:11.0pt;font-family:"Courier New"'> message =<o:p></o:p></span></p><div><p class=MsoNormal style='text-indent:.5in'><span style='font-family:"Cambria Math",serif;color:black'>​</span><span style='font-family:"Courier New";color:black'>  </span><span style='font-family:"Cambria Math",serif;color:black'>​</span><span style='font-family:"Courier New";color:black'><o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New"'>new QuickFix.FIX44.MarketDataRequest();</span><o:p></o:p></p></blockquote><blockquote style='margin-left:30.0pt;margin-right:0in'><div><p class=MsoNormal><span style='font-size:11.0pt;color:#222222'><o:p> </o:p></span></p></div></blockquote><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'>(Alternately you could, and probably should, just use </span><b><span style='font-size:11.0pt;font-family:"Courier New";color:red'>var</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> instead.)</span><span style='font-size:11.0pt'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'>That will cause </span><span style='font-size:11.0pt;font-family:"Courier New";color:#222222'>message</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'> to call the right version of </span><span style='font-size:11.0pt;font-family:"Courier New";color:#222222'>FromString()</span><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'>.</span><span style='font-size:11.0pt;color:#222222'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#222222'><o:p> </o:p></span></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Feb 9, 2016 at 10:51 AM, Philip Clem <<a href="mailto:pclem@4thstory.com" target="_blank">pclem@4thstory.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Using the “message.FromString()” API, and entering a message string with tags in the proper order, I end up with a message that has tags in numerical order.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>String messageText = “262=1263=1264=1265=1266=Y267=4269=0269=1269=2269=B146=155=TUR.2032.D03875460=6167=CORP”;<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'>QuickFix.Message message = new QuickFix.FIX44.MarketDataRequest();<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                QuickFix.IMessageFactory messageFactory = new QuickFix.DefaultMessageFactory();<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                QuickFix.DataDictionary.DataDictionary dataDict = new QuickFix.DataDictionary.DataDictionary(@"M:\X4S_4.6\Config\FIXN\FIX44_ECV.xml");<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                message.FromString(sb.ToString(), false, dataDict, dataDict, messageFactory);<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Resulting message string:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>9=12055=TUR.2032.D03875146=1167=CORP262=1263=1264=1265=1266=Y267=4269=0460=610=012<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>That, of course, means the message is incorrectly formed for a message like a MarketDataRequest that has grouped sections like: 146=1 55= TUR.2032.D03875.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Also I get the same incorrect numerical tag order if I use the API:<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in'>message.SetField(new QuickFix.Fields.StringField(pair.Tag, tagValue));<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Is there a way to prevent message tags from going into the message in numerical order?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F4E79'>Philip H. Clem</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#1F4E79'><a href="mailto:pclem@4thstory.com" target="_blank">pclem@4thstory.com</a></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div><p class=MsoNormal style='margin-bottom:12.0pt'><br>_______________________________________________<br>Quickfixn mailing list<br><a href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br><a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:10.0pt;background:white'>Grant Birchmeier</span><o:p></o:p></p></div><div><p class=MsoNormal><b><span style='font-size:10.0pt;color:#3333FF;background:#FFCC00'>Connamara Systems, LLC</span></b><o:p></o:p></p></div><div><p class=MsoNormal><b><span style='font-size:10.0pt'>Made-To-Measure Trading Solutions.</span></b><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'>Exactly what you need. No more. No less.</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='font-size:10.0pt'><a href="http://connamara.com" target="_blank">http://connamara.com</a></span><o:p></o:p></p></div></div></div></div></body></html>