forwardManipulating real numbers   Table of ContentFlat FIX Messageforward
Message Validation

FIX Engine has the ability to validate any incoming messages and to reject that does not fit for the FIX protocol or its FIX Dialect. As well the FIX Message class has the Validate() method for the validation. You can specify validation criteria by validation settings, please see below for details.

Validation settings

The following settings affect on the validation process:

Also, the validation takes place when you perform the FIX message parsing from its raw (tag=value) representation (by any corresponding constructor Message(String, MessageParsingFlags) or Parse(String, MessageParsingFlags) method). In this case, the validation is performed in accordance with the specified MessageParsingFlags. If the mentioned flag is not specified then the validation of validation aspects, which are present in the MessageParsingFlags enum, are not performed, other validation aspects will be validated in accordance with the FIX Engine validation settings.

Field value validation

The field value validation can be performed in two following ways:

  1. The validation of fields values in accordance with the FIX protocol data types. The 'type' attribute must be added to the 'Field' node in the FIX Dialect XML file. The value of the 'type' attribute must be in upper case mode, please see the example.

  2. The validation of fields values in accordance with enum valid values of the FIX protocol (example of 'HandlInst' field valid values). Also, you can specify your own enum valid values. In this case, the 'Type' definition must be added to the FIX Dialect XML file, and all enum values must be described in the 'Type' XML node. Additionally, the 'mode' attribute indicates that the action will be performed with your own enum valid values:

    • append - given valid values will be appended to valid values of the FIX protocol
    • override - given valid values will replace all valid values of the FIX protocol
    • remove - given valid values will be removed from valid values of the FIX protocol
    The 'name' attribute of the 'Type' XML node must correspond to the value of the 'type' attribute in the field definition, please see the example.

Example

A basic dialect description file with the field value type definition:

<?xml version="1.0" encoding="utf-8"?>
<Dialect xmlns="https://ref.onixs.biz/fix/dialects"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="https://ref.onixs.biz/fix/dialects https://ref.onixs.biz/fix/dialects/dialects-2.18.xsd">
  <FIX version="5.0">
    <Message type="D">
      <Field tag="52" name="SendingTime" type="UTCTIMESTAMP"/>
    </Message>
  </FIX>
</Dialect>

A basic dialect description file with the enum values definition:

<?xml version="1.0" encoding="utf-8"?>
<Dialect xmlns="https://ref.onixs.biz/fix/dialects"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="https://ref.onixs.biz/fix/dialects https://ref.onixs.biz/fix/dialects/dialects-2.18.xsd">
  <FIX version="5.0">
    <Type name="UserDefine" mode="append">
      <Value enum="4" description="enum description"/>
      <Value enum="5" description="enum description"/>
    </Type>
    <Message type="D">
      <Field tag="21" name="HandlInst" type="UserDefine"/>
    </Message>
  </FIX>
</Dialect>