[Quickfix-developers] Issues trying to parse an outgoing logon message in ruby-based implementation
Brought to you by:
orenmnero
From: Al <bro...@gm...> - 2010-01-13 17:12:48
|
Hi. I'm having issues with a ruby implementation of an Initiator. I'm required to attach the password in tag 554 to be embedded into the FIX login message for 35=A. Using "password" in the cfg file does not work. (It’s in the FIx4.4 spec but not in the Fix4.2 spec, which is what I’m supposed to use.) So, I added some code in my toAdmin method to embed the password into the message. For some reason, I get an “undefined method” error right where I need to parse the message. It seems that whatever is getting passed through the method toAdmin into the message parameter isn’t actually the type of object I’m expecting. But my little debug line suggests that it is. (I tried to use Marshal to take a better peak into message, but got a "no marshal_dump is defined for class Quickfix::SessionID" error.) def toAdmin(sessionID, message) puts "toAdmin: #{message.to_s}\n" # debug: Displays “toAdmin: FIX.4.2:GBR->LIME” beginString = Quickfix::BeginString.new msgType = Quickfix::MsgType.new message.getHeader().getField( beginString ) # Error: undefined method `getHeader' message.getHeader().getField( msgType ) if msgType.getValue() == "A" add_logon_field(message); end rescue Exception => e print "Error: #{$!}\n" print e.backtrace end Output: <20100113-17:03:21, FIX.4.2:GBR->LIME, event> (Created session) <20100113-17:03:21, FIX.4.2:GBR->LIME, event> (Connecting to xx.xxx.xxx.xxx on port 9650) toAdmin: FIX.4.2:GBR->LIME Error: undefined method `getHeader' for FIX.4.2:GBR->LIME:Quickfix::SessionID lime.rb:31:in `toAdmin'../lib/ruby/quickfix_ruby.rb:6:in `block'../lib/ruby/quickfix_ruby.rb:6:in `start'../lib/ruby/quickfix_ruby.rb:6:in `initialize'../lib/ruby/quickfix_ruby.rb:6:in `new'../lib/ruby/quickfix_ruby.rb:6:in `start'lime.rb:116<20100113-17:03:22, FIX.4.2:GBR->LIME, outgoing> (8=FIX.4.29=6635=A34=4949=GBR52=20100113-17:03:22.00256=LIME98=0108=3010=253) <20100113-17:03:22, FIX.4.2:GBR->LIME, event> (Initiated logon request) <20100113-17:03:22, FIX.4.2:GBR->LIME, event> (Socket Error: Connection reset by peer.) <20100113-17:03:22, FIX.4.2:GBR->LIME, event> (Disconnecting) I appreciate any help/suggestions. Best, -Al |