[Quickfix-developers] Getting Fields From Headers
Brought to you by:
orenmnero
|
From: Mike L. <Mik...@tr...> - 2006-02-01 16:14:29
|
I'm using QuickFix 1.11 with a C# app and I have a couple of questions
concerning Message Class, Header Class and getField() and getHeader().
I have a method in C# that accepts two messages, a QuickFix4.0.Message
and
a QuickFix42.Message. What I am trying to do is normalize all my
incoming
fix messages to conform to an internal version of 4.2. I created a
generic method to copy the header and trailer from the 4.0 msg to the
4.2
msg and I am having a world of problems. Is this possible to do or do I
have to do it at the specific message level (ie: NewOrder, Cancel, etc)?
I've noticed that the only way I can retrieve the fields stated without
it
throwing a FieldNotFound Exception are to use differenct combinations of
getheader and getfield. Otherwise if I try to use getField on specific
header fields then beginstring, bodylength, and msgtype all throw the
FieldNotFound Exception, if I try to use getHeader().GetField() on
specific header fields then sendercompid and targetcompid throw the
exception.
I've also tried to pull the header out:
QuickFix40.Header originalHeader =3D
(QuickFix40.Header)OriginalMessage.getHeader();
QuickFix42.Header newHeader =3D
(QuickFix42.Header)NewMessage.getHeader();
Compiles fine but give me a InvalidCastException: Specified cast is not
valid. How can I pull these out generically without having to repeat
code
at the specific message method level? Thanks!
Mike Lee
***************************************************************************=
********
This message and any files transmitted with it are confidential and intende=
d solely for the use of the individual or entity to whom it is addressed. I=
t may contain sensitive and private proprietary or legally privileged infor=
mation. No confidentiality or privilege is waived or lost by any mistransmi=
ssion. If you are not the intended recipient, please immediately delete it =
and all copies of it from your system, destroy any hard copies of it and no=
tify the sender. You must not, directly or indirectly, use, disclose, distr=
ibute, print, or copy any part of this message if you are not the intended =
recipient. Tradition Asiel Securities Inc. and Tradition (North America) In=
c. reserve the right to monitor all e-mail communications through its netwo=
rks. Any views expressed in this message are those of the individual sender=
, except where the message states otherwise and the sender is authorized to=
state them.
Unless otherwise stated, any pricing information given in this message is i=
ndicative only, is subject to change and does not constitute an offer to de=
al at any price quoted. Any reference to the terms of executed transactions=
should be treated as preliminary only and subject to our formal written co=
nfirmation. Tradition Asiel Securities Inc. and Tradition (North America) I=
nc. are not responsible for any recommendation, solicitation, offer or agre=
ement or any information about any transaction, customer account or account=
activity contained in this communication.
This footnote also confirms that this email message has been swept by
Anti-virus detection software for the presence of computer viruses.
***************************************************************************=
********
|