0

GetURLSegments method of the SharePoint SiteData web service return false when passed the address of a document library.

GetURLSegments return the following for the relative URL's: FALSE - http://sharepoint.testurl.com/site/subsite/doclibrary TRUE - http://sharepoint.testurl.com/site/subsite/doclibrary/folder1

When TRUE is returned I get the ID's for the related item. What is strange is when I pass in the root URL of the document library I get FALSE back. The documentation of this web method states the following:

Else if the strURL parameter is a URL of a list within the request site (2)<35>, the protocol server MUST return the GUID of the list. This GUID MUST be enclosed in curly braces ({}). I confirmed and the casing of the URL is the same as it is on the server.

Why is FALSE returned when I pass in the URL of the document library? Is there an easy way to determine the ID of the document library if I only have the root URL of the library?

JD Stuart
  • 547
  • 1
  • 3
  • 13

2 Answers2

0

What I found was, if, I pass an encoded URL e.g. http://host/site1/Shared%20Documents/Default.aspx then it returns false, but, if I pass the raw URL (e.g. with spaces) as http://host/site1/Shared Documents/Default.aspx then it returns true alongwith the GUID for containing list. Tested in Sharepoint 2010.

Bimalesh Jha
  • 1,464
  • 9
  • 17
0

Use Lists.GetListCollection Method to Get the Document Library GUID

The DefaultViewUrl allows you to verify against you URL

Alexandru Deliu
  • 546
  • 3
  • 17