IWMSBroadcastPublishingPoint.ExportXML (C#)

banner art

Previous Next

IWMSBroadcastPublishingPoint.ExportXML (C#)

The ExportXML method creates an XML file containing publishing point configuration data.


  string  strXMLFileName



[in] string containing the name of the XML file.

Return Values

This method does not return a value.

If this method fails, it throws an exception.

Number Description
0x8007000E The strXMLFileName argument is invalid. This can occur if an empty string is passed in.
0x00000003 The path indicated by the strDestinationFileName could not be found.
0xC00D145AL The publishing point has already been removed.


You can use the IWMSPublishingPoints.ImportXML method to create a new publishing point with the same settings as the current broadcast publishing point.

This method requires the Network Service account to have write and browse access to the specified path.

Example Code

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer                       Server;
IWMSBroadcastPublishingPoint    BCPubPoint;
IWMSPublishingPoints            PubPoints;
IWMSPublishingPoint             PubPoint;

string                          strFile;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints;

    // Retrieve each publishing point and retrieve the
    // IWMSBroadcastPublishingPoint object.
    for (int i = 0; i < PubPoints.Count; i++)
        PubPoint = PubPoints[i];

        if (PubPoint.Type == 
            BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

            // Export the publishing point configuration
            // information to an XML file.
            strFile = "C:\\wmpub\\wmroot\\pubpoint.xml";
            BCPubPoint.ExportXML (strFile);
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
catch (Exception e) {
    // TODO: Handle exceptions.


Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows ServerĀ 2003 family, Windows ServerĀ 2008 family.

See Also

Previous Next