Lists.asmx and Microsoft’s creative documentation

I’m currently working on a project which utilizes Microsoft SharePoint web services. Let’s say I maintain a Risk Management spreadsheet as a list in SharePoint. Microsoft’s documentation says you could use the GetListItems web method to query the server for any mish-mash of entries in that list. The documentation claims that this web service thing-a-ma-jig supports “arbitrarily complicated queries”; DON’T YOU BELIEVE IT.

First of all, they never tell you to group the criteria in pairs So let’s naively slap four criteria up against each other, like this:


< where>< and>< eq>< fieldref Name="Group_x0020_ID" />< value Type="Text">0109001001< /value>< /eq>< eq>< fieldref Name="Plan_x0020_ID" />< value Type="Text">RNR01A< /value>< /eq>< eq>< fieldref Name="Document_x0020_Type" />< value Type="Text">SMM< /value>< /eq>< gt>< fieldref Name="Effective_x0020_Date" />< value Type="DateTime">2/16/1992 12:15:12< /value>< /gt>< /and>< /where>

The server will return to you an error of type Microsoft.SharePoint.SoapServer.SoapServerException. This inherits from System.Web.Services.Protocols.SoapException, which gives you more a litte more info in the Detail property. Then you find the illuminating cause of the error:

SoapException.Details: < errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot complete this action. Please try again.< /errorstring>< errorcode xmlns="http://schemas.microsoft.com/sharepoint/soap/">0x80004005< /errorcode>

After several random guesses, I tripped over the fact that you need to format your criteria into pairwise conditions, like this:


< where>< and>
< /and>< and>
< eq>< fieldref Name="Group_x0020_ID" />< value Type="Text">0109001001< /value>< /eq>
< eq>< fieldref Name="Plan_x0020_ID" />< value Type="Text">RNR01A< /value>< /eq>
< /and>
< and>
< eq>< fieldref Name="Document_x0020_Type" />< value Type="Text">SMM< /value>< /eq>
< gt>< fieldref Name="Effective_x0020_Date" />< value Type="DateTime">2/16/1992 12:15:12< /value>< /gt>
< /and>
< /where>

Wouldn’t it be great if you just told me that; instead of only hinting at it through the examples?

But you’re not out of the woods yet. Now, the system returns ALL the list items, ignoring the criteria. According to a discussion on www.codecomments.com (which is dead in the water at the time of this writing), the service straight-up DOES NOT SUPPORT DATE QUERIES. Oh there’s more. Despite all the examples, despite my contorting the XML to avoid that exception, I never got this query to work. Instead of getting only the list items I was asking for, it stubbornly kept returing ALL the list items. Once I trimmed it town to two text-only criteria, I started getting the right results. But then I hear you say, “Jesse, you must have done something wrong. The examples never lie.” However, consider the fact that only two criteria are permitted when configuring a SharePoint view. Also, consider that Serge can’t get ANY criteria to work, and uses the DSTS web service instead. Given that coincidence, the previous two bald-faced lies, and other people’s pain, I’m given to think this only-two-criteria is more than just my fat-fingers or bad data.

So, I call out to all you techy types. Can you do more than I? Have you been able to run a Lists.asmx query with more than two criteria? The challenge is on.

20 Years Of Agility: Reflections, Tough Questions & Surprising Answers

As we approach the 20th anniversary of the “Manifesto for Agile Software Development”, it’s time to ask some big questions: Are projects really any more successful these days? Have companies truly shed any of the bureaucracy? Are professionals actually feeling the empowerment we’ve been fighting for so long? And where are things headed in the next few years?

Leaders Lean Into Ambiguity

This past year has taught me one lesson over and over: people need clarity to do great work. Yet too often, we hesitate to be the ones to provide it. When the path forward is unclear, we hold back, waiting for someone else to step up. But here’s the truth: clarity...

YES, Racial Justice Matters at the Office

We are at an inflection point in the american conversation about institutional racism. As project managers, departmental directors, VPs, scrum masters, we have influence in that institutional system. Therefore, we have a professional obligation to create a safe space for our black and brown colleagues, during this crisis moment. Here are 5 things you can do to promote racial justice and equality at your office.