|
From: Toli K. <to...@ma...> - 2007-04-30 14:41:02
|
Mohammad, If you look at the example in http://www.quickfixj.org/quickfixj/usermanual/usage/sending_messages.html, you'll see that you actually don't need to set any of the Header tags - QFJ takes care of that when you do Session.sendToTarget. So you need to make sure you setup your Session correctly with the initialization file, and then just set all of the specific fields for QuoteRequest. Then, just send it out - and QFJ will set the body length, message seq num, etc. So essentially you should only have this: > System.out.println("SENDING REQUEST FOR QUOTES"); > Message message = new Message(); > quickfix.fix44.QuoteRequest quoteRequest=new > quickfix.fix44.QuoteRequest(); > quoteRequest.setField(new QuoteReqID()); > quoteRequest.setField(new ClOrdID("Client Order ID")); > quoteRequest.setField(new NoRelatedSym(0)); > quoteRequest.setField(new NoUnderlyings(1)); > quoteRequest.setField(new Side('1')); > quoteRequest.setField(new QtyType()); > quoteRequest.setField(new Account("ACCOUNT")); > quoteRequest.setField(new NoLegs(2)); > quoteRequest.setField(new LegQty(2)); > quoteRequest.setField(new OrdType('1')); > quoteRequest.setField(new ExpireTime()); see the Repeating Groups example on how to correctly set repeating groups. You'll need to create one of these: quickfix.fix44.QuoteRequest.NoRelatedSym() Look at the thread http://www.nabble.com/Multi-leg-quote-request-exception-tf3644792.html#a10178926 for an example - keep in mind that in this example there was a missing field, see further messages. > Session.sendToTarget(quoteRequest,"client2","ifkaar"); Make sure your session is created correctly up front - otherwise, your message may not go through. Also, feel free to download and look through our OMS code as well. It's posted online, and there are lost of examples on how to create and send messages. http://trac.marketcetera.org/trac.fcgi/wiki/Marketcetera/BuildingPlatform -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |