Re: [Quickfix-developers] Custom Logon Message
Brought to you by:
orenmnero
From: Kenny S. <ks...@co...> - 2010-07-20 12:33:45
|
Hi Arup, You shouldn't the the 'crack' method call. That is for receiving messages. The way I code this would look something like: void FixApp::toAdmin(FIX::Message& msg, const FIX::SessionID& sessionID ) { FIX::MsgType msgType; msg.getHeader().getField(msgType); // if logon if( msgType.getValue() == FIX::MsgType_LOGON ) { FIX::Password pw( _my_password ); msg.setField( pw ); FIX::Username user( _my_username ); msg.setField( user ); } } -- Kenny Stone Connamara Systems, LLC On Mon, Jul 19, 2010 at 11:48 PM, Sarkar, Arup <sar...@gm...>wrote: > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Hi: > > I am very new to FIX and QuickFix in c++ engine. I am trying to build a > custom logon messsage since "Username" and "Password" is required by the > exchange. I am doing the following, basically overriding the toAdmin method. > > > Can someone please help me in stating if this is correct? > > void Application::toAdmin(FIX::Message& message, const FIX::SessionID& > sessionID) > { > std::string sLogon = "A"; > crack( message, sessionID ); > std::cout << "In toAdmin" << std::endl; > std::cout << message << std::endl; > try > { > if(sLogon.compare(message.getHeader().getField(35)) == 0 ) > { > std::cout<< " Setting username and password." << std::endl; > message.getHeader().setField(553, "XXXXXXXXX"); > message.getHeader().setField(554, "XXXXXXX"); > } > } > catch(FIX::FieldNotFound& eFieldNotFound) > { > std::cout<< eFieldNotFound.detail << std::endl; > } > } > > -- > Regards, > Arup > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > |