Webs.GetWeb Method
Returns properties of a site (for example, name, description, and theme).
Namespace: [Webs Web service]
Web service reference: http://Site/_vti_bin/Webs.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetWeb", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetWeb ( _
webUrl As String _
) As XmlNode
'Usage
Dim instance As Webs
Dim webUrl As String
Dim returnValue As XmlNode
returnValue = instance.GetWeb(webUrl)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetWeb", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetWeb(
string webUrl
)
Parameters
webUrl
Type: System.StringA 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
Type: System.Xml.XmlNode
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="https://schemas.microsoft.com/sharepoint/soap/" />
Examples
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);