Share via


Windows-based Hosting::CreateCustomerWebSite

This procedure creates a customer Web site and content directories.

Arguments

Input Arguments Description

<orgLdapPath>

The Lightweight Directory Access Protocol (LDAP) path of the organization that will own the Web site.

<webServerName>

A string representing the name of the server. This can be a NetBIOS name, a fully qualified domain name (FQDN), or an IP address.

<webRootShare>

This is the UNC path to the root of the hosted Web site directory. This path must be accessible via the MPF server and the account that is submitting this request must have permissions to create directories on that share (for example, \\WEB01\WebHosting).

<webRootPath>

The full path to the root Web location. This should be the local path to the share provided in webRootShare (for example, "c:\WebHosting").

<serverBindingsXMLString>

One or more instances with attributes containing the components of a Web site's server bindings.

<webSiteName>

The unique name for the Web site. It must be unique for the organization if the organization owns multiple Web sites. This name is used for easy lookup of the site.

<preferredDomainController>

<serverAutoStart>

The Web server will either be started or left in a stopped state depending on the value supplied. Allowed values are 0 which leaves the sever in a stopped state, or 1 which starts the server.

<frontpageExtendWeb>(NOT YET WINGTIPTOYSED)

FrontPage extensions will either be installed or not installed depending on the value supplied. Allowed values are 1, which will install Frontpage extensions, or 0 which won't install the extensions.

<anonymousUserPass>

Password for the automatically generated anonymous user anon@<orgname>.

<allowChangeToLogFiles>

Specifies whether organization admins should have write access to the log file directory and its contents. If set to 1, write access is granted. If set to 0 write access is not granted.

<algorithm>

Defines the server candidate selection behavior. The allowed values are (note these are case sensitive):

  1. tightPack: From the set of servers that can satisfy the capacity of an allocation, the servers are ranked favoring those with the least amount of free space.

  2. level: From the set of servers that can satisfy the capacity of an allocation, the servers are ranked favoring those with the most amount of free space.

  3. minSeverCount: From the set of servers that can satisfy the capacity of an allocation, servers are selected where the organization has already had databases allocated. If no appropriate servers are found meeting this criteria, then the procedure falls back to a "tightPack" algorithm or the algorithm specified in the @alternate optional parameter.

<ftpSiteName>

Name of the ftp site.

<megabytes>

The size to be allocated to the resource.

<sendCredentials>

<webDirName>

If this element is supplied, it will be the name of the Web directory structure that is created for the site. Otherwise, the value of <webSiteName> will be used as the directory name.

<logDirName>

If this element is supplied, it will be the name of the log file directory that is created for the site. Otherwise, the default value of "logfiles" will be used.

<uncUserPass>

If this element is present, a user is created and set with this password. The resulting user is then applied to the UncUserName property for the Web site.

<propertiesXmlString>

Collection of the customer's root Web properties. Any valid property setting supported by the IIS provider can be passed through here. Typical properties would include:

  1. AuthFlags: (optional) Integer. See IIS documentation for legal values.

  2. AppFriendlyName: (optional) string. Defaults to "Default Application".

  3. AppIsolated: (optional) integer. Uses IIS default.

  4. AppPoolId: (optional) string. IIS 6.0 only. App pool if it does not exist.

  5. Path: (prohibited) If present in the properties collection an exception will be thrown regarding an invalid parameter.

  6. AuthFlags: (prohibited) If present in the properties collection an exception will be thrown regarding an invalid parameter.

  7. DefaultLogonDomain: (optional) Any value supplied is ignored and replaced with the string "\"

<serverComment>

This is the friendly-name for the new Web site and will appear in ISM (e.g. www.contoso.com). If the element is not present, then the value of <webSiteName> will be used for this property.

<alternate>

Defines the alternate algorithm behavior if the minServerCount algorithm fails to find a candidate server. If provided, this alternate will be used to select the server candidate. If not provided the procedure will default to a "tightPack" alternate. This optional attribute is ignored for all algorithm values except "minServerCount."

Remarks

Method Syntax

 
public string   CreateCusotmerWebSite( 
                                        string orgLdapPath, string webServerName,  
                                        string webRootShare, string webRootPath, 
                                        string serverBindingsXmlString, string webSiteName 
                                        string preferredDomainController string serverAutoStart,  
                                        string frontpageExtendWeb, string anonympusUserPass,  
                                        string allowChangeToLogFiles, string webDirName,  
                                        string logDirName, string uncUserPass, 
                                        string propertiesXmlString, string serverComment, 
                                        string algorithm, string alternate, string ftpSiteName, 
                                        string megabytes, bool sendCredentials) 
 

Sample Code

Example XML Request

No example XML request.

Example XML Response

 
<response> 
  <data> 
    <orgLdapPath>LDAP://OU=WingTipToys,OU=consolidatedmessenger,OU=Hosting,DC=fabrikam,DC=Com</orgLdapPath> 
    <webServerName>app01-ra</webServerName> 
    <webRootShare>websites$</webRootShare> 
    <webRootPath>c:\websites</webRootPath> 
    <serverBindings> 
      <binding port="80" /> 
    </serverBindings> 
    <webSiteName>www.WingTipToys.com</webSiteName> 
    <preferredDomainController>AD01-wh.fabrikam.com</preferredDomainController> 
    <serverAutoStart>1</serverAutoStart> 
    <frontpageExtendWeb> 
    </frontpageExtendWeb> 
    <anonymousUserPass>Pass1word</anonymousUserPass> 
    <allowChangeToLogFiles> 
    </allowChangeToLogFiles> 
    <ftpSiteName>Default FTP Site</ftpSiteName> 
    <algorithm alternate="level">minServerCount</algorithm> 
  </data> 
</response> 
 

Typical C# Usage

 
//Get user name and password.                            
        string userName = this.Request.ServerVariables.Get("AUTH_USER"); 
        string pass = this.Request.ServerVariables.Get("AUTH_PASSWORD"); 
 
        //Set credentials.       
        objWS.PreAuthenticate = true; 
        objWS.Credentials = new NetworkCredential(userName,pass); 
        lblMsg.InnerHtml = mpsResponseHeaderLabel; 
 
        //Display response. 
        this.mpsResponse.DocumentSource = "";    
response = objWS.CreateCustomerWebSite(orgLdapPath, webServerName, webRootShare, webRootPath, serverBindingsXmlString, preferredDomainController serverAutoStart, frontpageExtendWeb, anonympusUserPass, allowChangeToLogFiles, webDirName, logDirName, uncUserPass, propertiesXmlString, serverComment, true); 
 
        // set the response XML to match the return from MPF 
        responseXml.LoadXml(response); 
        this.mpsResponse.Document = responseXml; 
 

Applies To

Managed Windows-based Hosting Web Service for:

  • Hosted Messaging and Collaboration version 3.5

  • Hosted Messaging and Collaboration version 3.0

  • Windows-based Hosting version 4.5

  • Windows-based Hosting version 4.0

  • Windows-based Hosting version 3.5

  • Windows-based Hosting for Applications version 1.0

See also

Tasks

Windows-based Hosting::ModifyCustomerWebSite
Windows-based Hosting::ControlCustomerWebSite

Other Resources

Windows-based Hosting::DeleteCustomerWebSite [HMC SDK2]