[Quickfix-users] Quickfix c# .net error getting some custom fields in TradeCaptureReport message
Brought to you by:
orenmnero
From: <pl...@ae...> - 2009-05-06 22:06:23
|
Please help to point out what I need to do in order to fix the following issue. error extracting some custom fields: 1. Trade capture report message are getting triggered in the onmessage method of my application as expected. public override void onMessage(QuickFix44.TradeCaptureReport message, SessionID sessionID) { try { ... // The code is extracting most fields including ICE custom fields that were added. // Tag 9018 - custom tag getting picked up NumOfLots rp_NumOfLots = new NumOfLots(); Console.WriteLine("rp_NumOfLots : " + message.get(rp_NumOfLots)); // Tag 9022 - custom tag getting picked up NumOfCycles rp_NumOfCycles = new NumOfCycles(); Console.WriteLine("rp_NumOfCycles : " + message.get(rp_NumOfCycles)); TradeDate rp_TradeDate = new TradeDate(); Console.WriteLine("rp_TradeDate : " + message.get(rp_TradeDate)); TransactTime rp_TransactTime = new TransactTime(); Console.WriteLine("rp_TransactTime : " + message.get(rp_TransactTime)); // The touble i'm having is with some of the fields , HubId //Tag 9300 HubId rp_HubId = new HubId(); //compiles but during execution QuickFix.FieldnotFound is displayed in exception Console.WriteLine("rp_HubId :" + message.getField(rp_HubId)); // the next line does not build...cannot convert from QuickFix.HubId to QuickFix.TradeReportID //Console.WriteLine("rp_HubId :" + message.get(rp_HubId)); 2. able to extract some of the fields and write to console. from code above...Console.WriteLine(" rp_LastQty : 50 rp_LastPx : 34.2 rp_NumOfLots : 1 rp_NumOfCycles : 16 rp_TradeDate : 20090506 rp_TransactTime : 5/6/2009 1:21:52 PM 3. the error i get on HubId field onMessage: TradeCaptureReport method failed at 16:27:06.3898443, yuk! QuickFix.FieldNotFound: Exception of type 'QuickFix.FieldNotFound' was thrown. at QuickFix.Message.mapGetField(IntField field, FieldMap* map) at QuickFix.Message.getField(IntField field) at com.aepsc.ICEFIXDealCapture.QFIXApplicationEvents.onMessage(TradeCaptureRe port message, SessionID sessionID) in C:\APPLICATIONS\ICEFIX\ICEFIXDealCapture\I CEFIXDealCapture\QFIXApplicationEvents.cs:line 364 4. Steps I followed to get custom fields added: followed these instructions very closely: http://www.nabble.com/Custom-Messages-Classes-Tutorial-td13495584.html high level: a. added ICE's custome fields to the FIX4.4.XML in the spec folder of my Quickfix downloaded application b. ran generate (no errors) c. batch compiled solution (no errors) d. added newly generated dll's to my c# .net project and recompiled e. was able to get to the newly added custon fields in my application f. excuted report. 5. I took a look at the quickfix_vs8.sln (TradeCapturereport.cs) in trying to determine what was wrong. Seems like Ruby generated the source ok. Hub ID is in the content as follows: (just like the other report items) public void set(QuickFix.HubId value) { setField(value); } public QuickFix.HubId get(QuickFix.HubId value) { getField(value); return value; } public QuickFix.HubId getHubId() { QuickFix.HubId value = new QuickFix.HubId(); getField(value); return value; } public bool isSet(QuickFix.HubId field) { return isSetField(field); } public bool isSetHubId() { return isSetField(9300); } although, it does not show HubId in. public class TradeCaptureReport : Message { public TradeCaptureReport() : base(MsgType()) {} static QuickFix.MsgType MsgType() { return new QuickFix.MsgType("AE"); } public TradeCaptureReport( QuickFix.TradeReportID aTradeReportID, QuickFix.TradeReportTransType aTradeReportTransType, QuickFix.ExecID aExecID, QuickFix.PreviouslyReported aPreviouslyReported, QuickFix.LastQty aLastQty, QuickFix.LastPx aLastPx, QuickFix.NumOfLots aNumOfLots, QuickFix.NumOfCycles aNumOfCycles, QuickFix.TradeDate aTradeDate, QuickFix.TransactTime aTransactTime) : base(MsgType()) { set(aTradeReportID); set(aTradeReportTransType); set(aExecID); set(aPreviouslyReported); set(aLastQty); set(aLastPx); set(aNumOfLots); set(aNumOfCycles); set(aTradeDate); set(aTransactTime); } .... Any ideas? Any help is appreciated. thx Paul |