Re: [Quickfix-developers] Parsing text field(tag=58) in QuickFix "email" message
Brought to you by:
orenmnero
From: Shubhi A. <sh...@to...> - 2020-02-10 16:55:10
|
Trying this now: int int_noLines = std::atoi(message.getField(noLinesOfText).getString().c_str()); FIX::NoLinesOfText group; message.get(group); FIX::Text textMessage; for(int i=0; i < int_noLines; i++){ std::cout << "Hey " << i << std::endl; group.get(textMessage); } However, i am getting compilation error saying that "class FIX::LinesOfText' has no member named 'get". Does that sound right? Shubhi Agarwal Core Engineering Software Developer Risk Front End, Risk Technology (India) p: +91-124-452-4911 On Thu, Feb 6, 2020 at 5:11 PM Grant Birchmeier <gbi...@co...> wrote: > You're trying to access field 58 like it's a top-level field. In the > Email (35=C) message, it is NOT a top-level field, so the engine has not > defined a get(text) function for this message type. It's in the > LinesOfText repeating group. > > You need to check the docs at the bottom of this page ("Reading Messages > With Repeating Groups"): > http://www.quickfixengine.org/quickfix/doc/html/repeating_groups.html > > You've got to first extract the LinesOfText group, then call get(text) on > *that*. > > On Thu, Feb 6, 2020 at 3:58 PM Shubhi Agarwal <sh...@to...> > wrote: > >> QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/ >> >> Hi, >> I have created a QuickFix server and a client who are communicating with >> each other in Email type messages (msgType = "C"). >> >> Code on the server to create Email message: >> >> std::cout << "Creating email message" << std::endl; >> FIX44::Email email = FIX44::Email( >> FIX::EmailThreadID("abc"), >> FIX::EmailType(FIX::EmailType_NEW), >> FIX::Subject("0")); >> json j; >> j["Client_Name"] = "TESTCLIENTNAME"; >> j["Client_Alias"] = "TESTCLIENTNAME"; >> j["TimeStamp"] = "86537573786783"; >> >> //email.setField(58, "Cancel My Order!"); >> >> std::string jsonDump = j.dump(); >> email.setField(58, jsonDump); >> email.setField(33,"1"); >> >> On the client side, I am able to parse all fields except tag = 58. The >> onMessage function on client end looks like this: >> >> void onMessage(const FIX44::Email& message, const >> FIX::SessionID& sessionID) override >> { >> std::cout << "On message called" << std::endl; >> FIX::EmailThreadID emailThreadId; >> FIX::EmailType emailType; >> FIX::NoLinesOfText noLinesOfText; >> message.get(emailType); >> message.get(emailThreadId); >> int int_noLines = >> std::atoi(message.getField(noLinesOfText).getString().c_str()); >> >> if(emailType == FIX::EmailType_NEW) >> { >> FIX::Text text; >> for(int i=0; i < int_noLines; i++){ >> std::cout << "Hey " << i << >> std::endl; >> message.get(text); *//This line >> is giving compilation error* >> } >> >> std::cout << " Email received with type = >> request " << std::endl; >> FIX44::Email email = FIX44::Email( >> FIX::EmailThreadID(emailThreadId), >> >> FIX::EmailType(FIX::EmailType_REPLY), >> FIX::Subject("1")); >> try >> { >> FIX::Session::sendToTarget( >> email, sessionID ); >> std::cout << "Email response sent >> " << std::endl; >> } >> catch ( FIX::SessionNotFound& ) {} >> } >> } >> >> Can someone please help me to figure out how to parse the text field in >> the incoming email message. I am using fix44. >> >> Thanks and regards >> Shubhi Agarwal >> Core Engineering Software Developer >> Risk Front End, Risk Technology (India) >> p: +91-124-452-4911 >> >> _______________________________________________ >> Quickfix-developers mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > > > -- > Grant Birchmeier > *Connamara Systems, LLC* > *Made-To-Measure Trading Solutions.* > Exactly what you need. No more. No less. > http://connamara.com > > This email, along with any attachments, is confidential. If you believe > you received this message in error, please contact the sender immediately > and delete all copies of the message. Thank you from Connamara Systems, LLC. |