Manipulating real numbers | Table of Content | Flat FIX Message |
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.
The following settings affect on the validation process:
The field value validation can be performed in two following ways:
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.
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:
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>