Returns properties of a site (for example, name, description, and theme).
Web Service: Webs
Web Reference: http://<Site>/_vti_bin/Webs.asmx
Visual Basic (Declaration)
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetWeb", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Function GetWeb ( _
webUrl As String _
) As XmlNode
Dim instance As Webs
Dim webUrl As String
Dim returnValue As XmlNode
returnValue = instance.GetWeb(webUrl)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetWeb", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
public XmlNode GetWeb (
string webUrl
)
Parameters
- webUrl
A string that contains the absolute URL of the site. To return information about the current site, a period (".") can be passed as the value of this parameter.
Return Value
An XML fragment in the following form that can be assigned to a System.Xml.XmlNode object.
<Web Title="Site_Name" Url=
"http://Server_Name/sites/Site_Name/Subsite_Name"
Description="Description" Language="1033" Theme="Theme"
xmlns="http://schemas.microsoft.com/sharepoint/soap/" />
The following code example displays the title of the specified site. This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.
Dim websService As New Web_Reference_Folder_Name.Webs()
websService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim myNode As XmlNode = websService.GetWeb("http://Server_Name/sites/Site_Name/Subsite_Name")
Dim strMessage As String = myNode.Attributes("Title").Value
MessageBox.Show(strMessage)
Web_Reference_Folder_Name.Webs websService = new Web_Reference_Folder_Name.Webs();
websService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlNode myNode = websService.GetWeb("http://Server_Name/sites/Site_Name/Subsite_Name");
string strMessage = myNode.Attributes["Title"].Value;
MessageBox.Show(strMessage);