Note that there are some explanatory texts on larger screens.

plurals
  1. POPython SOAP to MS WebService(SharePoint)(GetListItems)
    primarykey
    data
    text
    <p>I am attempting to pull list Items from a sharepoint server(via python/suds) and am having some difficulty with making queries to GetListItems. If i provide no other parameters to GetListItems other than the list Name, it will return all the items in the default view for that List. I want to query a specific set of items(ID=15) to be returned and a specific set of fields(Date and Description) to be returned for those items. Here is my SOAP packet:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope "xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;SOAP-ENV:Header/&gt; &lt;ns0:Body&gt; &lt;ns1:GetListItems&gt; &lt;ns1:listName&gt;MyCalendar&lt;/ns1:listName&gt; &lt;query&gt; &lt;Where&gt; &lt;Eq&gt; &lt;FieldRef Name="_ows_ID"&gt;15&lt;/FieldRef&gt; &lt;/Eq&gt; &lt;/Where&gt; &lt;/query&gt; &lt;viewFields&gt; &lt;FieldRef Name="Description"/&gt; &lt;FieldRef Name="EventDate"/&gt; &lt;/viewFields&gt; &lt;/ns1:GetListItems&gt; &lt;/ns0:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>This appears to conform to the WSDL, however, when making the query i get back a full list of items with all the fields(as if i did not pass any query XML at all).</p> <p>Any suggestions for a SOAP noob?</p> <p>Also, here is my python code that generated this XML:</p> <pre><code>query = Element('query') where = Element('Where') eq = Element('Eq') eq.append(Element('FieldRef').append(Attribute('Name', '_ows_ID')).setText('15')) where.append(eq) query.append(where) viewFields = Element('viewFields') viewFields.append(Element('FieldRef').append(Attribute('Name','Description'))) viewFields.append(Element('FieldRef').append(Attribute('Name','EventDate'))) results = c_lists.service.GetListItems('MyCalendar', None, query, viewFields, None, None) </code></pre> <p>Any help would be greatly appreciated!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload