Windows Media Player 11 SDK Creating the ServiceInfo Document Dynamically 

Windows Media Player SDK banner art

Previous Next

Creating the ServiceInfo Document Dynamically

You can use ASP to create your ServiceInfo document. This can give you greater flexibility in your online store by using the following techniques:

  • Dynamically generating the host name for URLs.
  • Changing URLs for localization based on locale and geoid parameters.
  • Dynamically appending query string parameters from the ServiceInfo URL to other URLs, such as the navigate page URL.

The following example code shows a simple ASP page that dynamically creates a ServiceInfo document:

<%
    Dim sHost
    Dim sLocale

    sHost = Request.ServerVariables("HTTP_HOST")
    sLocale = Request.QueryString("locale")
%>

<?xml version="1.0" encoding="utf-8"?>
<ServiceInfo Version="1.00" Key="MyCommerceService">
    <FriendlyName>My Online Store</FriendlyName>
    <ServiceTask1
        URL = "https://<%= sHost %>/service/html/Music.asp">
    </ServiceTask1>
    <ServiceTask2
        URL = "https://<%= sHost %>/service/html/Video.asp">
    </ServiceTask2>
    <ServiceTask3
        URL = "https://<%= sHost %>/service/html/Radio.asp">
    </ServiceTask3>
    <Navigate
        BaseURL = "https://<%= sHost %>/service/html/navigate.asp?myloc<%= sLocale %>">
    </Navigate>
</ServiceInfo>

The preceding example code uses ASP to retrieve the host name from the Web server and dynamically create the URLs in the document. The code also retrieves the locale query string parameter from the ServiceInfo request and appends it to the URL for the navigate page.

See Also

Previous Next