1

I'm querying SharePoint 2010 SOAP services using GetListItems. My understanding is that the URL for each item should be ows_EncodedAbsUrl. For regular lists of baseType=0, the URLs that come back look like this:

https://my.host.com/sites/My-Site/Lists/Interviews/272_.000

The problem is that this URL results in a HTTP 404 not found by the SharePoint server. So essentially, SharePoint is reporting a URL for an item that doesn't exist.

For document libraries (baseType=1) this does not appear to be an issue; the ows_EncodedAbsURL that comes back points straight to the file download, which is fine. For regular lists, it seems apparent the URL is referencing the right list and the right ID, but I don't have an explanation for the trailing _.000 part of the URL or why SharePoint would report a URL that goes nowhere.

What's the recommended way via CAMLQuery to get SharePoint to report a correct URL for a generic list item?

2

_.000 is used internally, if you open a site in Sharepoint Designer and look at a list, you'll see all those items referenced in that way.

In almost all cases, we end up building the URL to where we want to go manually with various pieces of the response using things like ows_ID. For a list item, you need to view or edit, so you end up constructing a url like:

"DispForm.aspx?ID=" $(this).attr("ows_ID");
  • Building the URL to DispForm is also problematic, because the list name in the URL doesn't necessarily have to be the same as the list name as returned by SOAP. Is there another parameter that would indicate the proper list URL so these DispForm URLs can be built safely? – FrobberOfBits Mar 31 '15 at 16:52
  • 1
    ows_FileRef has most of the components you'd want, which is similar to the encodedabsurl. It has the item ID and with some manipulation, you can extract the relative url out of it. Example of returned data: 4;#sites/mysite/Lists/Videos/4_.000 – Eric Alexander Mar 31 '15 at 17:02
  • So @PirateEric are you suggesting my best option might be to pull ows_FileRef, parse the URL to extract the proper path, then add the `DispForm.aspx?ID=" + ows_ID at the end? – FrobberOfBits Mar 31 '15 at 17:09
  • This is sounding like a realistic solution, and yet this is CRAZY that SharePoint won't in any form just give you the URL of an item. – FrobberOfBits Mar 31 '15 at 17:09
  • 1
    either method would work, ows_FileRef or ows_EncodedAbsUrl, the each require their own manipulation. It does give you the URL of the item, it just isn't usable in any fashion and it needs manipulated depending on what you need to do, view or edit an item. I always had to do the same thing in dataview web parts too, so it the same across all platforms, client side and server side. – Eric Alexander Mar 31 '15 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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