Re: [Quickfix-developers] How do I change the field of a message from the .net api?
Brought to you by:
orenmnero
From: Peter P. <pet...@ho...> - 2009-01-09 15:37:07
|
Dear Wilhem, I'm new to QuickFix but maybe I can help? As someone coming new to it, I also found that Quickfix was very tricky to use; it displays truly bizarre behaviour at times! I do not believe that you can build a message manually in this way, because Quickfix wants to understand the structure of what you are building (with repeating groups etc) and will probably just throw out things that it does not like. When I needed to do what you are trying, I decided to build a new message by knowing what fields should be present in the incoming message and getting those values explicitly then rebuilding the groups using the QF-standard way, not by simply setting fields manually. Yours, Dan Date: Thu, 8 Jan 2009 19:54:41 -0800 From: th...@cu... To: qui...@li... Subject: [Quickfix-developers] How do I change the field of a message from the .net api? hello Happy new year to all! I'm using the .net api I'm working on a gateway, I receive a message from my acceptor function fromApp(Message message, SessionID sessionID) 1) I basically need to change some fields from this message and forward back the message to my Initiator I'm basically doing this: message.removeField((int)49); message.removeField(56); Console.Out.WriteLine(">>>> m=" + message.ToString()); message.setField(49, "MAXP2"); // SenderCompID message.setField(56, "MAX2PRICE"); // TargetCompID Console.Out.WriteLine(">>>> m=" + message.ToString()); message.setString(49, "MAXP2"); // SenderCompID message.setString(56, "MAX2PRICE"); // TargetCompID Console.Out.WriteLine(">>>> m=" + message.ToString()); but when I call some ,remove, replace, setField, setString, nothing change the fields 49 and 56? 2) I also try to loop over the fields and create a new message but I do not get the correct field System.Collections.IEnumerator enum_ = message.GetEnumerator(); QuickFix.Field key = null; while(enum_.MoveNext()){ key = (Field)enum_.Current; message2.setField(key.getField(), (string)key.getObject()); } Here is what I see once this while execute: + message {8=FIX.4.29=22535=V34=249=BLABLA52=20090109-03:49:01.46456=GATEWAY146=155=6E Sep0848=6E012008090000003232167=FUT200=200809202=0207=TTSIM262=1/8/2009 7:49:01 PM172263=1264=10265=1266=Y267=3269=0269=1269=210=192} QuickFix.Message {QuickFix42.MarketDataRequest} + message2 {8=FIX.4.29=6935=V146=1262=1/8/2009 7:49:01 PM172263=1264=10265=1266=Y267=310=251} QuickFix42.MarketDataRequest Which is weird as message2 isn't at all like message? Any idea why? thanks a lot for your help Wilhem _________________________________________________________________ Choose the perfect PC or mobile phone for you http://clk.atdmt.com/UKM/go/130777504/direct/01/ |