Designing Custom Encoders

Validating and Testing the Custom Message Definition

Validating the Custom Message Definition

You can validate the encoding rules, along with the message definition in XML format, by clicking the validation button in the XSD Editor. If encoding rules are present, they are validated following validation of the XML grammar and semantics. An example output showing multiple errors is shown in the following figure.

Figure 20 Example Validation Result

Figure described in content.

Testing the Encoder Runtime Behavior

The Encoder Tester allows you to test the Encoder's runtime behavior at design time. To display the tester dialog, right-click the XSD file to display its context menu and select Encoder > Test, as shown in the following figure.

Figure 21 Starting the Encoder Tester

Figure described in content.

The Test Encoding dialog is shown in the following figure. The various fields are described briefly in the table following the figure. After the Decode test is complete, the result is placed in an XML file inside the current project. This file can then be validated as described in the preceding section. There is no automatic method for validating the Encode result, however.

Figure 22 Test Encoding Dialog

Image of Test Encoding Dialog.

Table 14 Test Encoding Dialog Fields

Section 

Field Caption 

Description 

Meta 

Select an Element 

Specifies the top-level element whose structure you want to test. 

XSD File 

Identifies the XSD file you have selected for testing. 

Input 

Decode/Encode 

Option buttons to select the direction of data flow for the test. Specifies whether encoding or decoding behavior is being tested. 

From/To String 

Specifies that the input or output data is in string format. If not checked, byte format is assumed. 

Data File 

Specifies the data file to use in the Decode test. 

XML Source File 

Specifies the source file to use in the Encode test. 

Source/Result Coding 

Specifies the encoding of the serialized data. See Data Encoding

Output 

File Name 

Specifies the file name to use for the test result. 

Folder 

Specifies the folder in which you want the output file to be placed. 

Overwrite Output 

Specifies whether or not you want to overwrite any existing output file having the same name. 

Created File 

Confirms that the output file has been created, along with the location. 

Debug 

Verbose Level 

Specifies the level of detail contained in the log file. The options are:

  • None

  • Info

  • Fine

  • Finer

  • Finest