Share via


SiteData.GetWeb method

Returns site and list metadata, as well as information about the users and site groups for the current SharePoint site.

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

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 ( _
    <OutAttribute> ByRef sWebMetadata As _sWebMetadata, _
    <OutAttribute> ByRef vWebs As _sWebWithTime(), _
    <OutAttribute> ByRef vLists As _sListWithTime(), _
    <OutAttribute> ByRef vFPUrls As _sFPUrl(), _
    <OutAttribute> ByRef strRoles As String, _
    <OutAttribute> ByRef vRolesUsers As String(), _
    <OutAttribute> ByRef vRolesGroups As String() _
) As UInteger
'Usage
Dim instance As SiteData
Dim sWebMetadata As _sWebMetadata
Dim vWebs As _sWebWithTime()
Dim vLists As _sListWithTime()
Dim vFPUrls As _sFPUrl()
Dim strRoles As String
Dim vRolesUsers As String()
Dim vRolesGroups As String()
Dim returnValue As UInteger

returnValue = instance.GetWeb(sWebMetadata, _
    vWebs, vLists, vFPUrls, strRoles, _
    vRolesUsers, vRolesGroups)
[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 uint GetWeb(
    out _sWebMetadata sWebMetadata,
    out _sWebWithTime[] vWebs,
    out _sListWithTime[] vLists,
    out _sFPUrl[] vFPUrls,
    out string strRoles,
    out string[] vRolesUsers,
    out string[] vRolesGroups
)

Parameters

  • vWebs
    Type: []

    An array containing information about the subsites under the current site, including their URLs and the dates they were last modified.

  • vLists
    Type: []

    An array containing information about the lists in the current site, including their GUIDS, Boolean values indicating whether they are empty, and the date they were last modified.

  • vFPUrls
    Type: []

    This parameter is not used but must be passed.

  • strRoles
    Type: System.String

    Information about the site groups on the current site in the following form:

  • vRolesUsers
    Type: []

    String array that contains information about the users for each site group in the following form:

  • vRolesGroups
    Type: []

    String array that contains information about the cross-site groups that are members of each site group on the site in the following form:

Return value

Type: System.UInt32
A 32-bit unsigned integer that returns 0 to indicate that the operation has completed.

Remarks

Any parameter of the GetWeb method can be set to a null reference (Nothing in Visual Basic).

Examples

The following code example displays information about each site group on the current site, including users and cross-site groups that are members of each group. This example assumes the existence of a label within the form of a Windows Application.

Dim srvSiteData As New Web_Reference_Name.SiteData()
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim siteMData As Web_Reference_Name._sWebMetadata = Nothing
Dim siteTime As Web_Reference_Name._sWebWithTime() = Nothing
Dim lstMData As Web_Reference_Name._sListWithTime() = Nothing
Dim urls As Web_Reference_Name._sFPUrl() = Nothing
Dim strSGroups As String
Dim strSGrpUsrs() As String
Dim strSGrpGrps() As String

srvSiteData.GetWeb(siteMData, siteTime, lstMData, urls, strSGroups, strSGrpUsrs, strSGrpGrps)

label1.Text = strSGroups + ControlChars.Lf

Dim usr As String

For Each usr In  strSGrpUsrs

    label1.Text += usr + ControlChars.Lf

Next usr

Dim grp As String

For Each grp In  strSGrpGrps

    label1.Text += grp + ControlChars.Lf

Next grp
Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Name._sWebMetadata siteMData = null;
Web_Reference_Name._sWebWithTime[] siteTime = null;
Web_Reference_Name._sListWithTime[] lstMData = null;
Web_Reference_Name._sFPUrl[] urls = null;
string strSGroups;
string[] strSGrpUsrs;
string[] strSGrpGrps;

srvSiteData.GetWeb(out siteMData, out siteTime, out lstMData, out urls, 
    out strSGroups,out strSGrpUsrs,out strSGrpGrps);

label1.Text = strSGroups + "\n";

foreach (string usr in strSGrpUsrs)
{
    label1.Text += usr + "\n";
}

foreach (string grp in strSGrpGrps)
{
    label1.Text += grp + "\n";
}

See also

Reference

SiteData class

SiteData members

WebSvcSiteData namespace