assertXMLEqual(expected, AXIOMUtil.stringToOM(result).toString());
}
public void testAdvancedFIXMessage() throws Exception {
Message message = new NewOrderSingle();
message.getHeader().setField(new BeginString(BEGIN_STRING));
message.getHeader().setField(new SenderCompID(SENDER_ID));
message.getHeader().setField(new TargetCompID(TARGET_ID));
message.getHeader().setField(new MsgSeqNum(SEQ_NUM));
message.setField(new Symbol(SYMBOL));
message.setField(new ClOrdID(CLORD_ID));
message.setField(new TradeOriginationDate(TX_DATE));
Group g1 = new Group(NoAllocs.FIELD, AllocAccount.FIELD);
g1.setField(new AllocAccount("ABC"));
g1.setField(new IndividualAllocID("PQR"));
message.addGroup(g1);
Group g2 = new Group(NoAllocs.FIELD, AllocAccount.FIELD);
g2.setField(new AllocAccount("MNO"));
g2.setField(new IndividualAllocID("XYZ"));
message.addGroup(g2);
message.getTrailer().setField(new CheckSum(CHECKSUM));
MessageContext msgCtx = new MessageContext();
FIXUtils.getInstance().setSOAPEnvelope(message, SEQ_NUM, SESSION_ID, msgCtx);
String result = msgCtx.getEnvelope().getBody().getFirstElement().toString();
String expected =