Serializing an eConnect document object

The serialization classes enable you to programmatically create eConnect document objects from your .NET application. However, to submit your document to the eConnect business objects, you must convert the .NET document object to the XML format that the business objects require. To convert a .NET document object to XML, use the .NET XmlSerializer and XmlDocument classes to produce a serialized version of your document.

In .NET, serialization is the process of converting an object into a form that can be persisted or transported. For eConnect, you typically convert your document object to a string. For more information about .NET serialization, refer to the .NET Framework SDK.

The following Visual Basic example shows how to create an eConnect sales invoice object and serializes the sales invoice to an XML file. The serialized information is then used with the CreateTransactionEntity method to create the sales invoice in Dynamic GP. As you review the example, note the following actions: