ReportingService2006.ListChildren(String) Méthode

Définition

Obtient une liste d'enfants d'un dossier spécifié.

public:
 cli::array <ReportService2006::CatalogItem ^> ^ ListChildren(System::String ^ Item);
public ReportService2006.CatalogItem[] ListChildren (string Item);
member this.ListChildren : string -> ReportService2006.CatalogItem[]
Public Function ListChildren (Item As String) As CatalogItem()

Paramètres

Item
String

URL complète pour le dossier.

Retours

Tableau d'objets CatalogItem. Cette méthode retourne un tableau CatalogItem vide si aucun enfant n'existe.

Exemples

using System;  
using System.Collections.Generic;  
using System.IO;  
using System.Text;  
using System.Web;  
using System.Web.Services;  
using System.Web.Services.Protocols;  

class Sample  
{  
    static void Main(string[] args)  
    {  
        ReportingService2006 rs = new ReportingService2006();  
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer" +  
            "/ReportService2006.asmx";  
        rs.Credentials =   
            System.Net.CredentialCache.DefaultCredentials;  

        CatalogItem[] items = null;  

        try  
        {  
            items = rs.ListChildren("/");  

            foreach (CatalogItem item in items)  
            {  
                Console.WriteLine("Name: " + item.Name);  
                Console.WriteLine("Path: " + item.Path);  
                Console.WriteLine("Type: " + item.Type.ToString());  
            }  
        }  

        catch (SoapException e)  
        {  
            Console.WriteLine(e.Detail.OuterXml);  
        }  
    }  
}  
Imports System  
Imports System.IO  
Imports System.Text  
Imports System.Web.Services  
Imports System.Web.Services.Protocols  

Class Sample  

    Public Shared Sub Main()  

        Dim rs As New ReportingService2006()  
        rs.Url = "http://<Server Name>/_vti_bin/ReportServer" + _  
            "/ReportService2006.asmx"  
        rs.Credentials = _  
            System.Net.CredentialCache.DefaultCredentials  

        Dim items As CatalogItem() = Nothing  

        ' Retrieve a list of all items   
        ' from the report server database.   
        Try  
            items = rs.ListChildren("/")  

            If Not (items Is Nothing) Then  
                For Each item As CatalogItem In items  
                    Console.WriteLine("Name: " + item.Name)  
                    Console.WriteLine("Path: " + item.Path)  
                    Console.WriteLine("Type: " + _  
                        item.Type.ToString())  
                Next  
            End If  

        Catch e As SoapException  
            Console.WriteLine(e.Detail.InnerXml.ToString())  
        End Try  

    End Sub  

End Class  

Remarques

Le tableau suivant présente les informations relatives aux en-têtes et aux autorisations sur cette opération.

En-têtes SOAP (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
Autorisations requises <xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>

Cette méthode retourne tous les enfants sur Item lesquels l’utilisateur a <xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems> l’autorisation.

L’appel ListChildren à la racine du catalogue, « / », renvoie la liste des sites de niveau supérieur.

S’applique à