Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:19:41+00:00 2026-06-06T03:19:41+00:00

I am developing a web application who needs to get the folders and sub

  • 0

I am developing a web application who needs to get the folders and sub folders who is on SharePoint and put on a TreeView representing the hierarchy.
My application is not running in the same server that SharePoint, so I think the best way to do this is through Web Services.

So I added a Web Reference to SiteData.asmx to my project and found the following code:

 Private Sub GetSiteData()
    Dim RootFolder As String = "http://mySharepointServer/site/doc_site"
    Dim DirWSSP As String = "http://mySharePointServer/_vti_bin/SiteData.asmx"


    'Definitions of TreeView
    Dim tree As TreeView
    Dim raiz As TreeNode
    Dim no As TreeNode

    tree = Page.FindControl("trvFolder")
    raiz = New TreeNode(RootFolder)
    tree.Nodes.Clear()
    tree.Nodes.Add(raiz)

    ' Definitions of web service
    Dim service As New SP_SiteData.SiteData

    service.Credentials = New System.Net.NetworkCredential("userID", "password", "domain")


    Dim enArray() As SP_SiteData._sFPUrl

    service.EnumerateFolder(RootFolder, enArray)

    Dim en As SP_SiteData._sFPUrl
    For Each en In enArray
        If en.IsFolder Then
            no = New TreeNode(en.Url)
            raiz.ChildNodes.Add(no)
        End If
    Next

End Sub

I copied this code from a forum on msdn but is not working, the service.EnumerateFolder always return an empty array, that is , enArray always comes Nothing and I get an error : Object Reference not set to an instance of an object.

This code works?
There is another way to do this?
I am very novice with web services and web applications.
OBS: I’m using Visual Studio 2010 and SharePoint 2010

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:19:42+00:00Added an answer on June 6, 2026 at 3:19 am

    I found the solution using the web service Lists.asmx.

    The problem is I am very novice in web develpment and I don’t know nothing about Sharepoint, so i don’t knew how to use the web services.

    The problem was I was providing the wrong url. The url must be like:

    http://mysharepointsite/site/subsite_or_list/_vti_bin/Lists.asmx
    

    and I was using

    http://mysharepointsite/_vti_bin/Lists.asmx
    

    The difference is I call the web Service lists.asmx on subsite.

    Another thing I didn’t know, is that what I was calling the folders are actually lists in sharepoint, so im method getlistitems(), must put the list Name as parameter.

    Anyway for futher help, if anybody have the same problem as i had follow this link :

    http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/99f3e9d0-6ecf-4b1d-8b68-d108f36aaacc

    And the code are that here from msd:
    http://msdn.microsoft.com/en-us/library/lists.lists.getlistitems(v=office.12)

    Sorry for the bad english….

    Thanks everybody

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im Developing a web application which is very critical. So authentication has to be
I am developing a Web application in Pylons on the Mac. My development server
I am developing a web application. For some reasons, I need to use external
I'm developing a web application for a company which I work for. My team
I am developing an web application using php. One of the requirement is the
I'm developing a web application for a new service, starting from Firefox 3.5. The
We are developing a web application using Spring framework and Hibernate ORM. As far
I am developing a web application based on JSF technology. I use Eclipse as
I'm developing a web application myself to follow some rssfeeds. My purpose is just
I'm developing a web application using ASP .NET MVC 1.0 and jQuery (including the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.