<div><font color="#000000"><font>It looks like a FIX message, but it isn't exactly. </font></font><font color="#000000"><font>It has no beginstring (e.g. "</font></font>8=FIX.4.4"), and I'm not sure what that 1128 is.<font color="#000000"><font><br>
</font></font></div><div><br></div><div>So (1) is happening because the header is invalid. Maybe if you replace 1128=9 with 8=FIX.4.4 it could get past that, but it might trip up on something else, like checksum.</div><div>
<br></div><div>I'm not sure what you're trying with (2). If you're not receiving a message over the wire, then MessageCracker shouldn't come into play.</div><div><br></div><div>Theoretically, for each line, you should be able to call FromString().</div>
<div><br></div><div>Something like this:</div><div> for each line in file: </div><div> msgStr = <line from file, possibly after you replace 1128=9 with proper beginstring></div><div> // not sure if FIX44, but let's say it is</div>
<div> QuickFix.FIX44.SecurityDefinition msg = new QuickFix.FIX44.SecurityDefinition();</div><div> msg.FromString(msgStr, false, dd, dd, _defaultMsgFactory);</div><div><br></div><div><div>Have a look at test CheckGroupCountTest() in this file:</div>
<div><a href="https://github.com/connamara/quickfixn/blob/master/UnitTests/DataDictionaryTests.cs">https://github.com/connamara/quickfixn/blob/master/UnitTests/DataDictionaryTests.cs</a></div><div>You can see how it uses Message.FromString().</div>
</div><div><br></div><div>The dd will need to be your CME DD. The boolean is whether to use validation. Steal the _defaultMsgFactory part from that test file.</div><div><br></div><div>Let me know if that will get you rolling.</div>
<div><br></div><div>-Grant</div><div><br></div><div><br></div><div><br></div><div class="gmail_quote">On Tue, Sep 11, 2012 at 8:37 PM, Ted Tworek <span dir="ltr"><<a href="mailto:ttworek@theleaguecorp.com" target="_blank">ttworek@theleaguecorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p style="margin:0in;margin-bottom:.0001pt;line-height:13.5pt;background:white;vertical-align:baseline">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Hi,</span></p><p style="margin:0in;margin-bottom:.0001pt;line-height:13.5pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial","sans-serif""> </span></p>
<p style="margin:0in;margin-bottom:.0001pt;line-height:13.5pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">I'm trying to read the static securities definition file from the CME, located at:<a href="ftp://ftp.cmegroup.com/fix/Production/secdef.dat.gz" target="_blank"><span style="color:#4a6b82;border:none windowtext 1.0pt;padding:0in;text-decoration:none">ftp://ftp.cmegroup.com/fix/Production/secdef.dat.gz</span></a></span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline;word-wrap:break-word;background-repeat:initial initial;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Since they seem to be standard fix messages, I thought I could use QuickFix to help me read them into C# rather than parsing the file myself. I created a test app that basically does what I want, but I'm having 2 issues:</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline;word-wrap:break-word;background-repeat:initial initial;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">1) I'm getting a QuickFix exception "Invalid message: Header fields out of order" when forming the message from the string. If I set the "validate" boolean to false, this message disappears and the constructor succeeds, but may be an indicator for the next issue.</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline;word-wrap:break-word;background-repeat:initial initial;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">2) Upon calling p.Crack, I'm getting the QuickFix exception "QuickFix.UnsupportedMessageType", but there doesn't seem to be any indication of what the message type is that is supposedly unsupported.</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline;word-wrap:break-word;background-repeat:initial initial;word-spacing:0px"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Anyway, maybe QuickFix wasn't intended to be used in this way, but any ideas on how to get this to work?</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Thanks,</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial","sans-serif"">Ted</span></p>
<p style="margin-right:0in;margin-bottom:12.0pt;margin-left:0in;line-height:13.5pt;background:white;vertical-align:baseline"><span style="font-size:10.5pt;font-family:"Arial","sans-serif""> </span></p>
<p class="MsoNormal">using System;</p><p class="MsoNormal">using System.IO;</p><p class="MsoNormal">using System.Collections.Generic;</p><p class="MsoNormal">using System.Text;</p><p class="MsoNormal">using QuickFix;</p>
<p class="MsoNormal">
</p><p class="MsoNormal">namespace TestQuickFix</p><p class="MsoNormal">{</p><p class="MsoNormal"> class Program : QuickFix.MessageCracker</p><p class="MsoNormal"> {</p><p class="MsoNormal"> static void Main(string[] args)</p>
<p class="MsoNormal"> {</p><p class="MsoNormal"> int count = 0;</p><p class="MsoNormal"> string line;</p><p class="MsoNormal"> </p><p class="MsoNormal"> Program p = new Program();</p>
<p class="MsoNormal"> StreamReader file = new StreamReader(@"C:\secdef.dat");</p><p class="MsoNormal"> </p><p class="MsoNormal"> while (((line = file.ReadLine()) != null && count < 10))</p>
<p class="MsoNormal"> {</p><p class="MsoNormal"> // ISSUE #1 REQUIRES false 2ND ARG WHEN CREATING THE MESSAGE</p><p class="MsoNormal"> Message m = new Message(line, false); </p><p class="MsoNormal">
</p><p class="MsoNormal"> // ISSUE #2 Exception of type 'QuickFix.UnsupportedMessageType' was thrown.</p><p class="MsoNormal"> p.Crack(m, new SessionID("beginString", "senderCompID", "targetCompID"));</p>
<p class="MsoNormal"> }</p><p class="MsoNormal"> </p><p class="MsoNormal"> file.Close();</p><p class="MsoNormal"> </p><p class="MsoNormal"> }</p><p class="MsoNormal"> </p><p class="MsoNormal">
public void OnMessage(QuickFix.FIX50.SecurityDefinition secDef, SessionID sessionID)</p><p class="MsoNormal"> {</p><p class="MsoNormal"> Console.WriteLine(secDef.ToString());</p><p class="MsoNormal">
}</p><p class="MsoNormal"> }</p><p class="MsoNormal">}</p></div></div><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><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div><font><span style="background-color:#000000"><span style="background-color:#ffffff">Grant Birchmeier</span></span></font><font><font color="#3333ff"><br></font></font></div>
<div><font><b><font color="#3333ff"><span style="background-color:#ffcc33"><span style="background-color:#ffcc66"><span style="background-color:#ffcc99"><span style="background-color:#ffffff"><span style="background-color:#ffcc00">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br>
</div><div><font><b>Made-To-Measure Trading Solutions.</b></font></div><div><font>Exactly what you need. No more. No less.</font><font><b><font color="#3333ff"><br></font></b></font></div><div><font><a href="http://connamara.com" target="_blank">http://connamara.com</a><br>
</font></div><br>