This documentation is archived and is not being maintained.

Work with Enhanced Presence Schema Files

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

With the XSD files, you can generate the presence data according to the schema specifications. This is more advantageous than transcribing the XML elements by hand. The latter is prone to typing errors.

To generate the data class from a schema:

  1. Create .NET Framework classes for the XML types defined in the XSD files. You can accomplish this by using Microsoft Xml Schema/DataTypes Support Utility (XSD.EXE). This tool is part of the .NET Framework SDK.
  2. Create presence data object by instantiating the resultant classes and assigning appropriate values.
  3. Serialize the presence data object to obtain its XML representation.
  4. Attach the XML blob to the SIP message body. The process used to attach an XML blob to a SIP message depends on the API used by your application. For more information, see Work with Enhanced Presence Using Unified Communications AJAX Service API, Work with Enhanced Presence Using Unified Communications Client API, and Work with Enhanced Presence Using Unified Communications Managed API version 1.0.

Steps 1-3 are discussed in this section.

Creating Enhanced Presence Data Classes from the XML Schemas

Demonstrates how to use XSD.EXE to create C# classes from a given XML Schema (XSD) file.

Instantiating and Initializing an Enhanced Presence Data Class

Demonstrates how to instantiate and initialize an Enhanced Presence data class in C#.

Serializing an Enhanced Presence Data Object to an XML Element

Demonstrates how to serialize an Enhanced Presence data object in C# to create the corresponding XML string.