IWMSBroadcastPublishingPoint.ExportXML (C#)

banner art

Previous Next

IWMSBroadcastPublishingPoint.ExportXML (C#)

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

Syntax

  IWMSBroadcastPublishingPoint
  .ExportXML(
  string  strXMLFileName
);

Parameters

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.

Remarks

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 == 
            WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST)
        {
            BCPubPoint = (IWMSBroadcastPublishingPoint)PubPoint;

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

Requirements

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