Freigeben über


ApplicationManifest class

 
Microsoft Office Live Communications Server 2005 with SP1

ApplicationManifest

The ApplicationManifest class defines the application manifest for a SIP application.

An application manifest is required for all Live Communications Server 1.0 applications, and provides the SIP message processing rules needed to correctly handle only those SIP messages of interest to the application. An application uses the ApplicationManifest object to register the application with the Live Communications Server through the ServerAgent object. Most applications will use only one manifest, but multiple manifests are supported.

The application manifest is represented as an XML document available to the application, either within the source or as a separate file. The document structure of the application manifest is as follows:

<?xml version="1.0" ?>
<lc:applicationManifest
   appUri="www.my_server_name_here.com/my_application_name_here"
   xmlns:lc=https://schemas.microsoft.com/lc/2003/05>
   --application attributes here--

   <lc:splScript>
	  --message filter script here--
    ]]></lc:splScript>

</lc:applicationManifest>

The application attributes must precede the message filter script. The lc:appUri attribute is a unique string containing the name of the running application, and is used to identify the application manifest to the server. An HTTP-style URI that contains the domain and the application name is required because it guarantees uniqueness. This URI must be registered upon installation with WMI using the MSFT_SIPApplicationSetting WMI class.

The message filter script must be written in the Microsoft SIP Processing Language (MSPL).

For more information on creating and implementing an application manifest, as well as a complete list of application attributes and MSPL instructions, see Application Manifests.

The ApplicationManifest class is derived from the System.Object class.

Public Methods

The ApplicationManifest class has the following public methods.

Method Description
Compile()

Parses the application manifest specified with the CreateFromFile or CreateFromString method and compiles the content.

CreateFromFile(String)

Static (Shared). Creates an instance of an ApplicationManifest object from a specified application manifest file.

CreateFromString(String)

Static (Shared). Creates an instance of an ApplicationManifest object from a specified string containing an application manifest.

Equals(Object)

Inherited from System.Object. Determines whether the specified System.Object is equal to the current System.Object.

GetHashCode()

Inherited from System.Object. Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

GetType()

Inherited from System.Object. Gets the System.Type of the current instance.

SetDebugOutput(Boolean)

Indicates whether the compiled application should be displayed when Compile is called.

ToString()

Inherited from System.Object. Returns a System.String that represents the current System.Object.

Public Properties

The ApplicationManifest class has the following public property.

Property Description
ApplicationUri Data type: String
Access type: Read-only

Contains the application URI as defined in the application manifest.

Example Code

The following code sample demonstrates the dynamic creation and compilation of an application manifest.

ServerAgent mySA;
string manifest = @"<?xml version=""1.0""?><lc:applicationManifest appUri=""" + 
	appURI + @""" xmlns:lc=""http://www.my_lc_server_here.com/lc/2003/05"">" +
	"\n" + @"<lc:requestFilter methodNames=""ALL"" strictRoute=""true""/>" +
	"\n" + @"<lc:responseFilter reasonCodes=""ALL"" />" +
	"\n" + @"<lc:proxyByDefault action=""true"" />" +
	"\n" + @"<lc:splScript><![CDATA[" +
	"\n" + @"   if (sipRequest)  {  Dispatch (""OnRequest"");  return; }" +				
	"\n" + @"   if (sipResponse)  {  Dispatch (""OnResponse"");  return; }" +				
	"\n" + @" ]]></lc:splScript>" +
	"\n" + @"</lc:applicationManifest>";

ApplicationManifest myAppManifest = ApplicationManifest.CreateFromString(manifest);
bool success = true;	

try 
{
	myAppManifest.Compile();
	Console.WriteLine("The application manifest was compiled successfully.");
}
catch(CompilerErrorException e)
{
	Console.WriteLine("The application manifest could not be compiled successfully:" + e.Message);
	success = false;
}

if (success)
{
	// Create a new ServerAgent, taking the object instance (presuming it has the dispatch handlers 
	// OnRequest and OnResponse implemented on it) and the application manifest as parameters.
	mySA = new ServerAgent(this, myAppManifest);
}

Requirements

Redistributable: Requires Microsoft Office Live Communications Server 2005 with SP1.
Namespace: Microsoft.Rtc.Sip
Assembly: ServerAgent (in ServerAgent.dll)

See Also

Creating an Application Manifest, Application Manifests

  
  What did you think of this topic?
  © 2008 Microsoft Corporation. All rights reserved.