TOC PREV NEXT INDEX


Generated XER Encode Methods



The generation of methods to encode data in accordance with the XML Encoding Rules (XER) is similar to how methods were generated in the BER/DER and PER cases discussed previously. For each ASN.1 production defined in the ASN.1 source file, a C# encode method may be generated. This function will convert a populated variable of the given type into an encoded ASN.1 message.

An encode method is only generated if it is required to alter the encoding of the base class method. The C# model is built on inheritance from a set of common run-time base classes. These run-time classes contain default implementations of encode/decode methods that handle the encoding/decoding of the basic types.

For simple assignments, the generation of an encode method is not necessary. For example, the following production will not result in the generation of an encode method:

	X ::= INTEGER
 

In this case, the generated C# class inherits the Asn1Integer base class and the default encode method within this class is sufficient to encode a value of the generated type.

In the case of XER, a custom encode method is only generated if:



Objective Systems, Inc.

102 Pickering Way, Suite #506
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX