Re: [Quickfix-developers] Message CallBack
Brought to you by:
orenmnero
From: Hozaifa A. A. <hoz...@ve...> - 2008-03-04 05:24:31
|
Hello, Create onLogon event and after logon u can send the request. Other things are correct unless ur having some error. From: qui...@li... [mailto:qui...@li...] On Behalf Of Parjeet Singh Sent: Tuesday, March 04, 2008 10:11 AM To: qui...@li... Subject: [Quickfix-developers] Message CallBack This is may be simple question but at moment it is tough for me. I may be missing some basic point or misunderstanding. I have created a created this code to connect to the client side. e.g. This is from form load event and the client can see the connection. SessionSettings settings = new SessionSettings("C:\\Documents and Settings\\ParjeetS\\Projects\\FIXBarxsAcorn\\FIXBarxsAcorn\\Initiator.config "); Application application = new Application(); FileStoreFactory storeFactory = new FileStoreFactory(settings); MessageFactory messageFactory = new DefaultMessageFactory(); ThreadedSocketInitiator initiator = new ThreadedSocketInitiator(application, storeFactory, settings, messageFactory); // SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings,messageFactory); initiator.start(); while (initiator.isLoggedOn() == true) { MessageBox.Show("Test"); } The issue or missing some major point is from where I should be sending message and receiving message for example in creating message in Send Message public void onCreate( SessionID sessionID ) { msg.getHeader().setField(new StringField(8, "FIX.4.2")); // SenderCompID msg.getHeader().setField(new StringField(49, "yyy-PRICES-TEST")); // TargetCompID, with enumeration msg.getHeader().setField(new StringField(56, "xxx -PRICES-TEST")); // MsgType msg.getHeader().setField(new CharField(35, 'R')); msg.setField(new CharField(54, "1")); msg.setField(new StringField(58, "Cancel My Order!")); Session.sendToTarget(message, "xxx-TEST", "yyy-PRICES-TEST"); } Receive Message public void fromApp( Message message, SessionID sessionID ) { crack( message, sessionID ) Price price = new Price(); message.getField(price); ClOrdID clOrdID = new ClOrdID(); message.getField(clOrdID); } How I will receive the message in the file that is defined directory. At the end I need to convert the above message to xml. I will appreciate your help. Thanks in advance. PS |