Export (0) Print
Expand All

Sites.GetSiteTemplates method

Returns information about the collection of site definitions and sites templates in the Web application.

Namespace:  WebSvcsites
Assembly:  STSSOAP (in STSSOAP.dll)

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetSiteTemplates", RequestNamespace = "http://schemas.microsoft.com/sharepoint/soap/", 
	ResponseNamespace = "http://schemas.microsoft.com/sharepoint/soap/", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public uint GetSiteTemplates(
	uint LCID,
	out Template[] TemplateList
)

Parameters

LCID
Type: System.UInt32

A 32-bit integer that specifies the locale identifier (LCID), for example, 1033 in English.

TemplateList
Type: []

A template array whose elements provide fields containing information about each template.

Return value

Type: System.UInt32
If successful, returns 0 as an unsigned integer.

To access the Sites service and its methods, set a Web reference to http://Server_Name/[sites/][Site_Name/]_vti_bin/Sites.asmx.

The following code example displays information about all the site definitions and site templates in the Web application.

Web_Reference_Folder_Name.Sites siteService = new Web_Reference_Folder_Name.Sites();
siteService.Credentials= System.Net.CredentialCache.DefaultCredentials;
string strDisplay = "";
Web_Reference_Folder_Name.Template[] templates;
siteService.GetSiteTemplates(1033, out templates);
foreach (Project_Name.Web_Reference_Folder_Name.Template template in templates)
{
    strDisplay += "Title: " + template.Title + "  Name: " + template.Name + 
        "  Description: " + template.Description + "  IsCustom: " + 
        template.IsCustom + "  ID: " + template.ID + "  ImageUrl: " + template.ImageUrl + 
        "  IsHidden: " + template.IsHidden + "  IsUnique: " + template.IsUnique + "\n\n";
}
MessageBox.Show(strDisplay);

Community Additions

ADD
Show:
© 2014 Microsoft