Hi,<div><br></div><div>The change from m.SetField to m.Header.SetField for setting the message type did the trick and things are now working.</div><div><br></div><div>However, you should be aware that the reason I used m.SetField was because of the message in the archives to Felipe on July 31, 2012.</div>
<div>Here's the relevant portion:</div><div><br></div><div><span style="white-space:pre-wrap"><font face="courier new, monospace">Problem 3: You were not using the correct message constructor. (The first</font></span></div>
<div><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><font face="courier new, monospace">parameter to Message(string,bool) is an entire FIX message string, not just
the 35 field.)
To construct your message with generic methods, it should look like this:
QuickFix.Message m = new Message();
m.Header.SetField(new BeginString("FIX.4.4"));
m.SetField(new QuickFix.Fields.StringField(35, "BW")); <==== This appears to be incorrect
</font></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><span style="font-family:arial;white-space:normal">Expanding the tutorial section on custom messages with some sample code for constructing messages generically, and for receiving them, would be a helpful addition. My solution to receiving the response to this "U1" message (CITI Tradestream) is:</span></pre>
<pre style="background-color:rgb(255,255,255)"><pre><font color="#222222" face="arial"><span style="white-space:normal"> public void FromApp(Message message, SessionID sessionID)</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> {</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> try</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> {</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> Crack(message, sessionID);</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> }</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> catch (Exception ex)</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> {</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> string msgType = message.Header.GetField(35);</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> if (msgType == "U2")</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> {</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> OnAccountDetailsMessage(message, sessionID);</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> }</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> else</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> {</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> string msg = "Tradestream Cracker exception: " + ex.ToString() + " StackTrace: " + ex.StackTrace;</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> Parent.FIX_RaiseErrorEvent(new ErrorEventArgs(ErrorType.Exception, 0, msg, 0, null));</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> }</span></font></pre>
<pre><font color="#222222" face="arial"><span style="white-space:normal"> }</span></font></pre><pre><font color="#222222" face="arial"><span style="white-space:normal"> }</span></font></pre><div style="color:rgb(34,34,34);font-family:arial;white-space:normal">
Is there a different recommended way to handle this? There is only one custom message I need to handle.</div></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><span style="font-family:arial;white-space:normal"><br>
</span></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><span style="font-family:arial;white-space:normal">Of course, I would prefer to build a system using Rudy that handles this correctly, as you recommend. I know this is not the right forum for this, but perhaps you can help with my problem installing Ruby so that I can run "gem install nokogiri" successfully. Here are the steps I took (my system is Windows 7):</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><font face="arial"><span style="white-space:normal">1. Install 64 bit Ruby using rubyinstaller-2.0.0-p0-x64.exe (it ends up in c:\Ruby200-x64)</span></font></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><font face="arial"><span style="white-space:normal">2. Install the dev kit DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe (extract into </span></font><span style="white-space:normal;font-family:arial">:\Ruby200-x64\DevKit, then follow the instructions through to jason, which was successful). There are three choices for the DevKit, but I could find no guidance as to which one to use so I chose the one with two occurrences of 64 in its name.</span></pre>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)"><span style="white-space:normal;font-family:arial">3. Run "gem install nokogiri". This results in:</span></pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);background-color:rgb(255,255,255)">
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">c:\Ruby200-x64\DevKit>gem install nokogiri</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Temporarily enhancing PATH to include DevKit...</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Building native extensions. This could take a while...</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">ERROR: Error installing nokogiri:</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> ERROR: Failed to build gem native extension.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> C:/Ruby200-x64/bin/ruby.exe extconf.rb</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">The system cannot find the path specified.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">checking for libxml/parser.h... no</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">-----</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">libxml2 is missing. please visit <a href="http://nokogiri.org/tutorials/installing_nokogiri.html" target="_blank" style="color:rgb(17,85,204)">http://nokogiri.org/tutorials/installing_nokogiri.html</a> for help with installing dependencies.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">-----</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">*** extconf.rb failed ***</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Could not create Makefile due to some reason, probably lack of necessary</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">libraries and/or headers. Check the mkmf.log file for more details. You may</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">need configuration options.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Provided configuration options:</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-opt-dir</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-opt-dir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-opt-include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-opt-include=${opt-dir}/include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-opt-lib</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-opt-lib=${opt-dir}/lib</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-make-prog</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-make-prog</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --srcdir=.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --curdir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --ruby=C:/Ruby200-x64/bin/ruby</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-zlib-dir</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-zlib-dir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-zlib-include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-zlib-include=${zlib-dir}/include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-zlib-lib</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-zlib-lib=${zlib-dir}/lib</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-iconv-dir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-iconv-dir</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-iconv-include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-iconv-include=${iconv-dir}/include</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-iconv-lib</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-iconv-lib=${iconv-dir}/lib</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xml2-dir</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xml2-dir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xml2-include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xml2-include=${xml2-dir}/include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xml2-lib</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xml2-lib=${xml2-dir}/lib</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xslt-dir</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xslt-dir</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xslt-include</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xslt-include=${xslt-dir}/include</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-xslt-lib</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-xslt-lib=${xslt-dir}/lib</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-libxslt-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-libxslt-config</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-pkg-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-pkg-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-libxml-2.0-config</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-libxml-2.0-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-pkg-config</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-pkg-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-libiconv-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-libiconv-config</span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --with-pkg-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"> --without-pkg-config</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal"><br></span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9 for inspection.</span></font></pre>
<pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/ext/nokogiri/gem_make.out</span></font></pre><pre style="white-space:pre-wrap">
<font face="arial"><span style="white-space:normal"><br></span></font></pre><pre style="white-space:pre-wrap"><font face="arial"><span style="white-space:normal">c:\Ruby200-x64\DevKit></span></font></pre><div style="font-family:arial;white-space:normal">
<br></div><div style="font-family:arial;white-space:normal">The tutorials referenced here are no help --- the implication is that "gem install nokogiri" will not fail on Windows.</div><div style="font-family:arial;white-space:normal">
Searching the web provided many wild and wonderful suggestions, none of which worked. I did try "gem install nokogiri -- --with-xml2-lib --with-xslt-lib --platform=ruby" to no avail.</div>
<div style="font-family:arial;white-space:normal">I am a total novice with Ruby, so I could be missing something simple.</div><div style="font-family:arial;white-space:normal"><br></div><div style="font-family:arial;white-space:normal">
Thanks</div><div style="font-family:arial;white-space:normal">Roger</div><div><br></div></pre></div>