Understanding the Namespace
The namespace is a section of memory that is reserved for server configuration data. The servernamespace.xml file is used to hold these settings and namespacedelta.xml is used to store the most recent server configuration changes. At regular intervals, the configuration changes in namespacedelta.xml will be merged with servernamespace.xml.
The namespace uses XML nodes to store various properties of the server, publishing points, and plug-ins. Each node has attributes assigned to it. Typically, a node has a name assigned to it and an operation is performed on it. The following code snippet shows a node named "Allow Unicast" that is created with a Boolean value set to "true".
<node name="Allow Unicast" opcode="create" type="boolean" value="true" />
You can programmatically edit the name and value of a node by using the IWMSNamedValue interface. The C# Cache Proxy Plug-in sample provides an example of persisting configuration information to the server's namespace. For more information, see C# Cache Proxy Plug-in Sample.
The following table describes each of the attributes that can be assigned to a node.
Attribute |
Description |
Additional remarks |
---|---|---|
name |
A required attribute that contains the name of the node. |
None. |
opcode |
A required attribute that performs one of the six operations described in the next column. |
The six valid opcodes are: create: Create a new node in memory. remove: Remove an existing node from memory. setval: Assign a new value to an existing node. clearval: Make the value empty for an existing node. rename: Change the name of an existing node. movebefore: Move an existing node to the position immediately before the node named in the value. For example: <node name="NewPubPoint" opcode="movebefore" type="string" value="Sample_Broadcast"> This would move the node called NewPubPoint to the position immediately before the node called Sample_Broadcast. |
secure |
An optional Boolean attribute that allows you to store data in a secure place in the registry. |
Only a string data type can be secured in the registry. |
type |
An optional attribute that describes the data type of the value attribute. The five data types are listed in the next column. |
The five valid data types are: string: Value attribute is a string data type. boolean: Value attribute can be either "true" or "false". int32: Value attribute is a 32-bit value in hexadecimal format. binary: Value attribute is in binary format. int64: Value attribute is a 64-bit value in hexadecimal format. |
value |
An optional attribute containing the value for the node. |
None. |
Note
If the server shuts down before namespacedelta.xml and servernamespace.xml are merged, the server will merge the files during the shut-down process. If Windows Media Services crashes before the current settings in namespacedelta.xml can be merged into servernamespace.xml, Windows Media Services will attempt to merge the two files upon startup, before those settings are updated in memory.
See Also
Reference
IWMSNamedValue Object (Visual Basic .NET)