FIXMLMapping Handler

FIXMLMapping Handler

Overview

FIXMLMapping Handler is a FIXEdge plugin that implements FIX-to-FIXML and FIXML-to-FIX encoding according to the FIX standard. The structure is defined within dictionaries. The ‘abbrName’ attribute is used to define attribute/element name used with FIXML. So, It can be customized the same way as regular FIX protocols. If, for some reason, abbrName is not defined for a tag, then its name, which is mandatory, is used instead. The same is applied for blocks and repeating groups. If there is no ‘abbrName’ attribute for a message then the handler falls back to pseudo FIXML format. MsgType_<message type> is used instead of message name, and FIXML element replaced with regular XML to avoid standard breakage. Here are two examples to compare. The first on is FIXML and the second one is pseudo FIXML format.

FIXML format

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <FIXML v="FIX.5.0.SP2"> <SecDef SecurityReportID="3400001" SecurityReqID="1234567" SecurityResponseType="100"> <Hdr SenderCompID="CME" SenderSubID="CPAPI" TargetCompID="BRKR" TargetSubID="user"/> <Instrument ListMethod="0" MinPriceIncrement="0.01" PriceQuoteMethod="STD" PriceUnitOfMeasure="Bbl" PriceUnitOfMeasureQty="1" ProductComplex="ENRGY" SecTyp="FUT" SecurityDesc="WTI Calendar Swap" SecurityExchange="NYMEX" SecurityID="CS" SecurityIDSource="H" SettlMethod="C" TimeUnit="Mo" UnitOfMeasure="Bbl" UnitOfMeasureQty="1000"/> <InstrmtExt> <Attrb InstrAttribType="29" InstrAttribValue="Y"/> <Attrb InstrAttribType="25" InstrAttribValue="1"/> <Attrb InstrAttribType="24" InstrAttribValue="2"/> <Attrb InstrAttribType="24" InstrAttribValue="12"/> </InstrmtExt> <Custom Tag_123456789="This is custom"/> </SecDef> </FIXML>

Pseudo FIXML format

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <XML cv="FIX44_CUSTOM" v="FIX.4.4"> <MsgType_W MDReqID="MDReqID222" Tag_2001="67890" field2000="12345"> <SMH DeliverToCompID="BARCTEST_EU_EM_T3" MsgSeqNum="2" SenderCompID="TESTI" SendingTime="20230113-22:00:15.685" TargetCompID="TESTA"/> <Instrument SecurityID="US0378331005" SecurityIDSource="4" Symbol="MSFT"/> <NoMDEntries MDEntryPx="222" MDEntrySize="2" MDEntryType="0"/> <NoMDEntries MDEntryPx="333" MDEntrySize="3" MDEntryType="1"/> </MsgType_W> </XML>

Handler functions

FIXMLMapping Handler performs the following functions:

  • Converts any FIX message to FIXML and stores it to XML message (MsgType = n) or any other message type of the user's choice.

  • Converts any FIXML message contained in XML message (MsgType = n) or any other message type back to FIX message.

Configuration parameters

The handler is configured as part of the business logic in BL_Config.xml, along with other FIXEdge handlers.

The table below represents the FIXMLMapping Handler config properties.

Property name

Description

Required

Property name

Description

Required

Common BL handlers configuration properties

Name

Reference name used in the Business Logic Actions.

Example: FIXMLMapping

Y

Description

A description defined by a user.

Example: FIXMLMapping Handler

Y

DllName 

Path to a library, starting from RootDir.

Example: ./libFIXMLMappingHandler.so

Y

VerifyHandlersVersion

If set to "true" FIXEdge C++ prevents the use of an unexpected version of the module in order to avoid incompatible changes between two different FIXEdge C++ versions.

The recommended value is "true".

If the version of the handler is different from the FIXEdge C++ version, the module will not be loaded and the corresponding error will be logged.

N

Specific FIXMLMapping Handler configuration properties

Direction

The direction of the conversion.

Valid values: FIX-to-FIXML | FIXML-to-FIX

Y

MessageType

MsgType of the encoded message container. Applicable only to FIX-to-FIXML encoding.

Valid values: any MsgType value

The default value: n



FieldTag

The tag to put FIXML to or to get FIXML from depending on conversion direction.

Valid values: any tag number

The default value: 213

N

IncludeCustomTags

Determines whatever to include custom tags to resulting FIXML (the tag with prefix ‘Tag_’ is used as an attribute name) or to accept custom tags from incoming FIXML. Custom tags are placed under <Custom/> element at message root element. For example, ‘<Custom Tag_123456789="This is custom"/>’

Valid values: true | false

The default value: false

N

FIXVersion and ParserVersion properties define the dictionary to use.

FIX-to-FIXML conversion:

If the FIXVersion and ParserVersion properties are not defined then the container message will have the same version as the source message has.

FIXML-to-FIX conversion:

If the FIXVersion and ParserVersion properties are not defined then the source container message property values will be used.

ParserVersion

The value of the ParserVersion property is parser template string.

FIX-to-FIXML conversion:

The ParserVersion property defines which parser (dictionaries set) to use as the wrapper for the resulting FIXML content, not the parser used to interpret the source FIX message. If the ParserVersion property is not defined, then the source message parser will be used.

FIXML-to-FIX conversion:

The ParserVersion property defines which parser (dictionaries set) to use for the resulting FIX message. If the ParserVersion is not defined, then the parser of the source container FIX message will be used.

Examples:

ParserVersion="ICE@FIXT11:FIX44_ICE", FIXVersion="FIX44_ICE" - the FIX44_ICE application protocol dictionary over FIXT11 session will be used. The value of the ParserVersion property must be defined in the AdditionalParsersList list in the engine.properties file.

ParserVersion="MyParser@", FIXVersion="FIX50SP2_custom" - the FIX50SP2_custom application protocol dictionary of the custom MyParser parser will be used. The value of the ParserVersion property must be defined in the AdditionalParsersList list in the engine.properties file.

ParserVersion - not provided, FIXVersion="FIX44" - the FIX44 application protocol dictionary from the source FIX message will be used.

N

FIXVersion

The value of the FIXVersion property is the 'id' attribute of the protocol loaded from xml dictionary file.

FIX-to-FIXML conversion:

The FIXVersion property defines which particular protocol version from the set (defined by the ParserVersion property) to use.

If the FIXVersion property is not defined then the default application-level protocol version of the parser defined by the ParserVersion property will be used.

FIXML-to-FIX conversion:

The FIXVersion property defines the particular protocol version to use if FIXML message doesn't provide the version explicitly by means of ‘v' and 'cv’ attributes when applicable.

If the FIXVersion property is not defined then the default application-level protocol version of the parser defined by the ParserVersion property will be used.

Examples:

ParserVersion="FIXT11:FIX44,FIX50SP2", FIXVersion="FIX50SP2" - the standard FIX50SP2 application protocol from standard dictionaries will be used.

ParserVersion="ICE@FIXT11:FIX44_ICE", FIXVersion - not provided - the FIX44_ICE application protocol dictionary over FIXT11 session will be used since there is only one application-level protocol version is specified for the parser. The value of the ParserVersion property must be defined in the AdditionalParsersList list in the engine.properties file.

N

FIX-to-FIXML Conversion Example

In the example below FIXMLMapping Handler is configured to convert FIX message to FIXML message and store in the 213 tag of XML message (MsgType = n).

BL Rule

BL_Config.xml
<DllHandlers> <Handler Name="FIXMLMapping" Description="FIXMLMapping Handler" DllName="./FIXMLMappingHandler-MD-x64.dll" VerifyHandlersVersion="true"/> </DllHandlers> <Rule Description="Mapping handler with only default properties"> <Source> <FixSession SenderCompID="Client1" TargetCompID="Client2"/> </Source> <Action> <HandlerAction Name="FIXMLMapping" Direction="FIX-to-FIXML"/> <Send> <FixSession SenderCompID="Client2" TargetCompID="Client1"/> </Send> </Action> </Rule>

Input Message

8=FIXT.1.1|9=271|35=d|49=Client1|56=Client2|50=CPAPI|57=user|1128=9|320=1234567|323=100|48=CS|22=H|167=FUT|207=NYMEX|107=WTI Calendar Swap|969=0.01|996=Bbl|997=Mo|1147=1000|1227=ENRGY|1191=Bbl|1192=1|1193=C|1196=STD|1198=0|870=4|871=29|872=Y|871=25|872=1|871=24|872=2|871=24|872=12|964=3400001|123456789=This is custom|10=246

Output Message

8=FIXT.1.1|9=638|35=n|49=Client2|56=Client1|34=2|52=20230306-12:37:06.130|1128=10|212=560|213=<?xml version="1.0" encoding="UTF-8" standalone="no" ?><FIXML v="FIX.5.0.SP2"><SecDef SecurityReportID="3400001" SecurityReqID="1234567" SecurityResponseType="100"><Hdr SenderCompID="Client1" SenderSubID="CPAPI" TargetCompID="Client2" TargetSubID="user"/><Instrument ListMethod="0" MinPriceIncrement="0.01" PriceQuoteMethod="STD" PriceUnitOfMeasure="Bbl" PriceUnitOfMeasureQty="1" ProductComplex="ENRGY" SecTyp="FUT" SecurityDesc="WTI Calendar Swap" SecurityExchange="NYMEX" SecurityID="CS" SecurityIDSource="H" SettlMethod="C" TimeUnit="Mo" UnitOfMeasure="Bbl" UnitOfMeasureQty="1000"/><InstrmtExt><Attrb InstrAttribType="29" InstrAttribValue="Y"/><Attrb InstrAttribType="25" InstrAttribValue="1"/><Attrb InstrAttribType="24" InstrAttribValue="2"/><Attrb InstrAttribType="24" InstrAttribValue="12"/></InstrmtExt><Custom Tag_123456789="This is custom"/></SecDef></FIXML>|10=061

FIXML-to-FIX Conversion Example

In the example below FIXMLMapping Handler is configured to convert FIXML message contained in the 213 tag of XML message (MsgType = n) to FIX message with the same version as the source FIX message had.

BL Rule

BL_Config.xml
<DllHandlers> <Handler Name="FIXMLMapping" Description="FIXMLMapping Handler" DllName="./FIXMLMappingHandler-MD-x64.dll" VerifyHandlersVersion="true"/> </DllHandlers> <Rule Description="Default properties"> <Source>   <FixSession SenderCompID="Client1" TargetCompID="Client2"/> </Source> <Action> <HandlerAction Name="FIXMLMapping" Direction="FIXML-to-FIX" FIXVersion=""/> <Send> <FixSession SenderCompID="Client2" TargetCompID="Client1"/> </Send> </Action> </Rule>

Input Message

8=FIXT.1.1|9=638|35=n|49=Client1|56=Client2|34=2|52=20230306-12:37:06.130|1128=10|212=560|213=<?xml version="1.0" encoding="UTF-8" standalone="no" ?><FIXML v="FIX.5.0.SP2"><SecDef SecurityReportID="3400001" SecurityReqID="1234567" SecurityResponseType="100"><Hdr SenderCompID="Client1" SenderSubID="CPAPI" TargetCompID="Client2" TargetSubID="user"/><Instrument ListMethod="0" MinPriceIncrement="0.01" PriceQuoteMethod="STD" PriceUnitOfMeasure="Bbl" PriceUnitOfMeasureQty="1" ProductComplex="ENRGY" SecTyp="FUT" SecurityDesc="WTI Calendar Swap" SecurityExchange="NYMEX" SecurityID="CS" SecurityIDSource="H" SettlMethod="C" TimeUnit="Mo" UnitOfMeasure="Bbl" UnitOfMeasureQty="1000"/><InstrmtExt><Attrb InstrAttribType="29" InstrAttribValue="Y"/><Attrb InstrAttribType="25" InstrAttribValue="1"/><Attrb InstrAttribType="24" InstrAttribValue="2"/><Attrb InstrAttribType="24" InstrAttribValue="12"/></InstrmtExt><Custom Tag_123456789="This is custom"/></SecDef></FIXML>|10=061

Output Message

8=FIXT.1.1|9=271|35=d|49=Client2|56=Client1|50=CPAPI|57=user|1128=9|320=1234567|323=100|48=CS|22=H|167=FUT|207=NYMEX|107=WTI Calendar Swap|969=0.01|996=Bbl|997=Mo|1147=1000|1227=ENRGY|1191=Bbl|1192=1|1193=C|1196=STD|1198=0|870=4|871=29|872=Y|871=25|872=1|871=24|872=2|871=24|872=12|964=3400001|123456789=This is custom|10=246