I am attempting to access a Sharepoint 2007 web service though iOS HTTP calls. The communication protocol is SOAP (1 and 1.2). I am able to successfully execute GetList and GetListAndView. However, when I try GetListItems, I get any number of error messages, none of which make any sense.
The format of the SOAP call (1.2 in this case; but the same issue exists for 1.0) for GetListItems is this:
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<GetListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>TaskListSample2-0</listName>
<viewName>{13C5392C-7DBC-4803-A3B8-B377D8566A55}</viewName>
<query><Query><Where><Or><Eq><FieldRef Name="Title"></FieldRef><Value Type="Text">Test</Value></Eq><IsNotNull><FieldRef Name="Title"></FieldRef></IsNotNull></Or></Where></Query></query>
<viewFields><ViewFields><FieldRef Name="Title" /><FieldRef Name="Status" /></ViewFields></viewFields>
<rowLimit>100</rowLimit>
<queryOptions></queryOptions>
<webID>c069106a-8d18-43d6-81c2-2687f568a3c5</webID>
</GetListItems>
</soap12:Body>
</soap12:Envelope>
The structure of the content between <Query>...</Query>
is exactly the same as it is formatted in a a successful .Net call to this function.
I get the following error message back:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<soap:Code>
<soap:Value>soap:Receiver</soap:Value>
</soap:Code>
<soap:Reason>
<soap:Text xml:lang="en">Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</soap:Text>
</soap:Reason>
<detail>
<errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Root element is missing.</errorstring>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I have spent days on this, along with a couple of other programmers who are versed in .Net and Sharepoint. Depending on various editing changes to the query, we have also seen "element <Query>
in query is missing or invalid."
I have also, by the way, attempted all of these SOAP calls through Fiddler2 on a Windows box. I see the same exact results as with the iOS HTTP calls.
The closest answer I've been able to get is that the query is formatted incorrectly (duh). But for the life of me, the correct format is eluding us. We have been able to successfully query the server from a native .Net app, but copying the exact content and format of the query XML over to the iOS code changes nothing.
Needless to say, the Microsoft documentation and error messages are criminally useless. And no, we cannot move to MOSS 2010. The client will not be updating any time soon, so we have to work with the technology they have in place.
Any help at all will be incredibly appreciated. Even if someone can definitively demonstrate that that particular web service function is broken for 2007. While it would suck, at least we would know that we aren't totally stupid. But if anyone can identify that I am actually formatting the query wrong and show me how to fix it, that would be amazing.
Thanks.