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

  • Home
  • SEARCH
  • 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 521965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:18:19+00:00 2026-05-13T08:18:19+00:00

I am accessing SharePoint via its web services… Which are a bit limited, as

  • 0

I am accessing SharePoint via its web services… Which are a bit limited, as a result I have turned to WebDav to perform some create folder functionality…

I have a document library, and I am about to create a folder using webdav, but I can’t find any documentation on the internet or anywhere else on how to check if a folder already exists using webdav, so is there a way to check if a folder exists in a document library in SharePoint, any hack and slash methods welcome!

  • 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-05-13T08:18:20+00:00Added an answer on May 13, 2026 at 8:18 am

    Somehow, I don’t get your question. First sentence states you are using web service (I’d normally understand it as the SOAP web services provided by SharePoint). The next one says you are using WebDAV which is a completely different protocol.

    So, WebDAV is the protocol “Windows Explorer” uses to access SharePoint, if you open it it “Explorer mode”. Since all these requests are actually HTTP requests, you can spy on them, using the “Fiddler” tool.

    I believe, before opening a folder, Windows Explorer tries to query sharepoint, if such folder exists. If I try to open an unexistant path \\mysrv\sites\myweb\mylib\notthere (but \\mysrv\sites\myweb\mylib is an existing document library!) thru windows explorer, the last HTTP call I see is:

    PROPFIND /sites/myweb/mylib HTTP/1.1
    User-Agent: Microsoft-WebDAV-MiniRedir/6.1.7600
    Depth: 1
    translate: f
    

    Where SharePoint responds with: a list of subfolders and pages in this folder (very long XML, but it contains items like this):

    <D:multistatus
        xmlns:D="DAV:"
        xmlns:Office="urn:schemas-microsoft-com:office:office"
        xmlns:Repl="http://schemas.microsoft.com/repl/"
        xmlns:Z="urn:schemas-microsoft-com:">
      <D:response>
        <D:href>http://sites/myweb/mylib</D:href>
        <D:propstat>
          <D:prop>
            <D:displayname>mylib</D:displayname>
            <D:lockdiscovery/>
            <D:supportedlock/>
            <D:isFolder>t</D:isFolder>
            <D:iscollection>1</D:iscollection>
            <D:ishidden>0</D:ishidden>
            <D:getcontenttype>application/octet-stream</D:getcontenttype>
            <D:getcontentlength>0</D:getcontentlength>
            <D:resourcetype>
              <D:collection/>
            </D:resourcetype>
            <Repl:authoritative-directory>t</Repl:authoritative-directory>
            <D:getlastmodified>2009-12-07T09:07:19Z</D:getlastmodified>
            <D:creationdate>2009-11-06T13:30:26Z</D:creationdate>
          </D:prop>
          <D:status>HTTP/1.1 200 OK</D:status>
        </D:propstat>
      </D:response>
      <!---List of other <D:response> elements -->
    </D:multistatus>
    

    If the contained element is a folder, it must have “D:isFolder” value “t”. This way you can find, if the parent folder contains the folder you are going to create.

    EDIT: created a small c# sample which first reads the result stream and then parses the result a bit. You need to make it better, to see if the list contains the folders you need or not.

    System.Net.HttpWebRequest oReq;
    string sUrl = "http://yoursite/sites/somesite/DocumentLibrary";
    oReq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(sUrl);
    
    oReq.Method = "PROPFIND";
    oReq.Credentials = System.Net.CredentialCache.DefaultCredentials;
    oReq.AllowAutoRedirect = true;
    oReq.UserAgent = "Microsoft-WebDAV-MiniRedir/6.1.7600";
    
    //this causes all of the items to be enumerated, 
    //if it is 0, only the folder itself is returned in the response
    oReq.Headers["Depth"] = "1";
    oReq.Headers["translate"] = "f";
    System.IO.StreamWriter oRequest =
            new System.IO.StreamWriter(oReq.GetRequestStream());
    oRequest.WriteLine();
    oRequest.Close();
    System.IO.StreamReader oResponse =
            new System.IO.StreamReader(oReq.GetResponse().GetResponseStream());
    string sResponse = oResponse.ReadToEnd();
    oResponse.Close();
    
    //done with the webclient stuff, check the results
    
    System.Xml.XmlDocument oMyDoc = new System.Xml.XmlDocument();
    oMyDoc.LoadXml(sResponse);
    System.Xml.XmlNamespaceManager oNsMgr =
            new System.Xml.XmlNamespaceManager(oMyDoc.NameTable);
    oNsMgr.AddNamespace("D", "DAV:");
    
    System.Xml.XmlNodeList oAllResponses =
            oMyDoc.SelectNodes(".//D:multistatus/D:response", oNsMgr);
    
    foreach (System.Xml.XmlNode oNode in oAllResponses)
    {
        Console.WriteLine("Name: " + 
                          oNode.SelectSingleNode("./D:propstat/D:prop/D:displayname",
                          oNsMgr).InnerText);
    
        if (oNode.SelectNodes("./D:propstat/D:prop/D:isFolder", oNsMgr).Count > 0)
        {
            Console.WriteLine("Is folder: " + 
                    oNode.SelectSingleNode("./D:propstat/D:prop/D:isFolder", 
                    oNsMgr).InnerText);
        }
        else
        {
            Console.WriteLine("Is folder: f");
        }
        Console.WriteLine();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am accessing Sharepoint web services from a Silverlight application, I have put the
Out of the several ways of accessing the SharePoint model of a SharePoint Services
While accessing a webservice which is availbale at http://recpushdata.cyndigo.com/jobs.asmx , I am getting this
I am accessing custom UIComponent via SWC file from Flex 3. This component works
I've looked at a lot of the previous questions asked about sharepoint and accessing
Just wondering if you know how to accessing controls on a sharepoint master page
Is accessing a bool field atomic in C#? In particular, do I need to
When accessing an object in a DataTable retrieved from a database, are there any
When accessing values from an SqlDataReader is there a performance difference between these two:
Best recommendations for accessing and manipulation of sqlite databases from JavaScript.

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.