quickfix - How to parse a string FIXMessage into a FIXMessage object in c# -


i have string fix message input , want convert fix message. using quickfix 1.13.3 (which downloaded few days quickfix website)

i quite new quickfix. of sample code/help google returned java , no straight forward way suggested when application has fixmessage payload string.

most of samples have seen on web cases people using quickfix end end i.e. communication on socket message , cracking it.

in case have own communication layer deliver me string payload represent full fledge fix message. need parse string , list of tag/values.

though wrote small utility myself parse fix message using standard string.split().... suggested me use quickfix support everything.

but quite struggling start basic task on quickfix re parsing string payload appreciated.

below looking for

//convertor or cracker

public quickfix44.message getmessage(string payload); 

//caller

string newordersinglepayload = "8=fix.4.49=13635=d..............";  quickfix44:message message = getmessage(newordersinglepayload);  if (message quickfix44.newordersingle)  {     //i happy } 

if quickfix simple work open use anyother tool (free & opensource)

quickfix designed end-to-end. of classes can used other purposes, there not documentation these less-common use-cases.

you can pass fix strings message constructor.

// uses default datadictionary (e.g. message definitions fix spec) message::message( const std::string& string, bool validate )  // uses datadictionary supply. // if msg has custom fields, need one. // (you'll create dd custom msg definition xml file // you'll need create) message::message( const std::string& string,                   const datadictionary& datadictionary,                   bool validate ) 

to convert message more specific type, can feed more-specific-type constructor, such executionreport(message).

have considered quickfix/n, native c# port?

this work quickfix/n:

imessagefactory _defaultmsgfactory = new defaultmessagefactory();  var dd = new quickfix.datadictionary.datadictionary(); dd.load("../../../spec/fix/fix44.xml");  var msg = new quickfix.fix44.executionreport(); msg.fromstring(msg_string, false, dd, dd, _defaultmsgfactory); 

if xml has heavy customizations, want regenerate source , rebuild libraries first.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -