Programming Guide

Introduction

This tool enables converting FIX message to FIXML and vice versa. The following sample code demonstrates how simple it is.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
final Engine engine = Engine.init();
final FixmlConverter converter = new FixmlConverter("sample/schema/fixml-main-4-4.xsd", Version.FIX44);
//
final String inFixFile = "site/Order.txt";
LOG.info("Loading FIX message from file: {}", inFixFile);
final Message inFixMessage = Utils.readFixMessage(inFixFile);
LOG.info("Input FIX message: {}", inFixMessage);
final String fixmlMessage = converter.fix2fixml(inFixMessage);
LOG.info("Output converted FIXML message: {}", fixmlMessage);
//
final String inFixmlFile = "site/ExecRpt.xml";
LOG.info("Loading FIXML message from file: {}", inFixmlFile);
final String inFixmlMessage = Utils.readFixmlMessage(inFixmlFile);
LOG.info("Input FIXML message: {}", inFixmlMessage);
final Message outFixMessage = converter.fixml2fix(fixmlMessage);
LOG.info("Output converted FIX message: {}", outFixMessage);
//
engine.shutdown();

Custom FIXML dictionaries

FixmlConverter class has the second constructor with the schemaPath parameter. This parameter should specify the path to the custom FIXML DTD file.

To convert custom FIXML messages the following steps should be taken:

  • Download the standard FIXML Schema or DTD for the required FIX Protocol version from http://fixprotocol.org .
  • Modify the FIXML Schema/DTD.
  • Create FixmlConverter class instance and specify the path to the file with custom FIXML Schema/DTD in its constructor.

Custom FIXML dictionaries can be used for new tags addition or standard group using in different FIX messages. If you would use a new custom FIX message or repeating group then you need, additionally, to add it in your code by the following methods before converting:

biz.onixs.fix.fixml.FixmlConverter.addCustomMessage(String, String)biz.onixs.fix.fixml.FixmlConverter.addCustomRepeatingGroup(int, String)

Samples

Check also Samples :: FIXML Converter.