I verified url (http://portal.inhouse.dev/sites/promo/libray1/test.txt) but following method always returns false. It should return true per MS. Please suggest. I even tried it with http://archive.msdn.microsoft.com/webservicestudio20 and still returns false and nulls for output fields.

public static string GetListItemIDByUrl(string url)
    sitedataservice.SiteData sd = new sitedataservice.SiteData();
    sd.Url = "http://basesmcdev2/sites/tester1/_vti_bin/sitedata.asmx";
    sd.UseDefaultCredentials = true;

    string webId = string.Empty;
    string listId = string.Empty;
    string itemId = string.Empty;
    string bucketId = string.Empty;

    bool ret = sd.GetURLSegments(url, out webId, out bucketId, out listId, out itemId);

    return itemId;
  • I am experiencing the same problem when passing in the URL of a document. The only time I get a TRUE from GetURLSegments is when the URL I pass in is just "sharepoint2010". However in this case all IDs returned are null. Has anyone any ideas?
    – user8352
    Commented May 15, 2012 at 8:50

2 Answers 2



Your web service call has context of the web "tester1" but you're looking for a file in the web "promo". The web service can only get files for the web in which it currently has context.


As I understand this post, you retrieves FALSE value because the item is located in the _vti_bin bin directory. This is virtual directory, not a list.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.