IWMSOnDemandPublishingPoint.ExportXML (Visual Basic .NET)

The ExportXML method creates a file that contains publishing point configuration data.

IWMSOnDemandPublishingPoint.ExportXML(
  strXMLFileName As String
)

Arguments

strXMLFileName

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

Return Value

If this method succeeds, it does not return a value. If fails, it returns an error number.

Number

Description

0x00000003

The path indicated by strXMLFileName was not found.

0xC00D145AL

The publishing point has already been removed.

Remarks

You can use the XML file to create a new publishing point with the same settings as the existing publishing point.

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

Example

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub CreateXMLConfig()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim ODPubPoint As IWMSOnDemandPublishingPoint
    Dim strFile As String

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve each publishing point and retrieve the
    ' IWMSOnDemandPublishingPoint object.
    For Each PubPoint In PubPoints

        If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND Then
            ODPubPoint = PubPoint
            Exit For
        End If

    Next

    ' Export the publishing point configuration
    ' information to an XML file.
    strFile = "c:\wmpub\wmroot\odpubpoint.xml"
    ODPubPoint.ExportXML(strFile)

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

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

Reference

IWMSOnDemandPublishingPoint Object (Visual Basic .NET)