PreviousNext

Creating Portable Data via the IDL Encoding Services

The IDL encoding services provide client and server RPC applications with a method for encoding data types in input parameters into byte stream format and decoding data types in output parameters from a byte stream without invoking the RPC runtime. Encoding and decoding functions are just like marshalling and unmarshalling, except that the data is stored locally and is not transmitted over the network; the IDL encoding services separate the data marshalling and unmarshalling functions from interaction with the RPC runtime.

Client and server applications can use the IDL encoding services to "flatten'' (or "serialize'') a data structure, even binary data, and then store it; for example, by writing it to a file on disk. An RPC application on any DCE machine, regardless of its data type size and byte endianess, is then able to use the IDL encoding services to decode previously encoded data. Without the IDL encoding services, you cannot create a file of data on one machine and then successfully read that data on another machine that has different size data types and byte endianess.

The IDL encoding services can generate code that takes the input parameters to a procedure and places them in a standard form in one or more buffers that are delivered to user code. This process is called encoding. Encoded data can be written to a file or forwarded by a messaging system. The IDL encoding services can also generate code that delivers, as the output parameters of a procedure, data that has been converted into the standard form by encoding. Delivery of data in this way is called decoding. Data to be decoded can be read from a file or received by a messaging system.

Applications use the ACF attributes encode and decode as operation attributes or as interface attributes to direct the IDL compiler to generate IDL encoding services stubs for operations rather than generating RPC stubs. See Attribute Configuration Language for usage information on encode and decode.

More:

Memory Management

Buffering Styles

IDL Encoding Services Handles

Programming Example

Performing Multiple Operations on a Single Handle

Determining the Identity of an Encoding