Sharepoint/SOAP - GetListItems ignoring query

2024/10/9 0:22:03

Trying to talk from Python to Sharepoint through SOAP.

One of the lists I am trying to query contains 'ID' as primary key field.

(Field){_RowOrdinal = "0"_FromBaseType = "TRUE"_DisplayName = "ID"_Name = "ID"_SourceID = "http://schemas.microsoft.com/sharepoint/v3"_ColName = "tp_ID"_StaticName = "ID"_PrimaryKey = "TRUE"_ReadOnly = "TRUE"_Type = "Counter"_ID = "{1d22ea11-1e32-424e-89ab-9fedbadb6ce1}"
},

We send the following request to query the list item with ID=77

<?xml version="1.0" encoding="UTF-8"?>
<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/"><SOAP-ENV:Header/><SOAP-ENV:Body><ns1:GetListItems><ns1:listName>60e3f442-6faa-4b49-814d-2ce2ec88b8d5</ns1:listName><query><Query><Where><Eq><FieldRef Name="ID"/><Value Type="Counter">77</Value></Eq></Where></Query></query></ns1:GetListItems></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However Sharepoint returns all items from the list completely ignoring the query.

Any idea?

Answer

The actual turned out to be that it is necessary to use

<ns1:query> 

here (for whatever reason).

https://en.xdnf.cn/q/118571.html

Related Q&A

python mean between file

I create a list of more than a thousand file (Basically now I have a list with the name of the file) now in order to make the man I thought to do something like this (suppose asch file have 20 lines): …

Sort a dictionary with custom sorting function

I have some JSON data I read from a file using json.load(data_file){"unused_account":{"logins": 0,"date_added": 150},"unused_account2":{"logins": 0,&qu…

Turtle make triangle different color

Hi guys Im trying to replicate this image:Its almost done I just have one issue, where the triangle is supposed to be yellow it isnt seeming to work.Mine:Code:fill(True) fillcolor(green) width(3) forwa…

How to DataBricks read Delta tables based on incremental data

we have to read the data from delta table and then we are joining the all the tables based on our requirements, then we would have to call the our internal APIS to pass the each row data. this is our g…

Converting an excel file to a specific Json in python using openpyxl library with datetime

I have the Excel data with the format shown in the image preview. How can I convert it into a JSON using Python? Expected Output: file_name = [ { A: Measurement( calculated_date=datetime(2022, 10, 1, …

How to find a word in a string in a list? (Python)

So im trying to find a way so I can read a txt file and find a specific word. I have been calling the file with myfile=open(daily.txt,r)r=myfile.readlines()that would return a list with a string for ea…

How to make a new default argument list every time [duplicate]

This question already has answers here:The Mutable Default Argument in Python(34 answers)Closed 10 years ago.I have the following setup:def returnList(arg=["abc"]):return arglist1 = returnLis…

How does one reorder information in an XML document in python 3?

Lets suppose I have the following XML structure:<?xml version="1.0" encoding="utf-8" ?> <Document><CstmrCdtTrfInitn><GrpHdr><other_tags>a</other_t…

Python - Replace only exact word in string [duplicate]

This question already has answers here:How to match a whole word with a regular expression?(4 answers)Closed 4 years ago.I want to replace only specific word in one string. However, some other words h…

How to write Hierarchical query in PYTHON

The given input is like:EMPLOYEE_ID NAME MANAGER_ID101 A 10102 B 1110 C 111 D 11 E nullEmployee Cycle LEVEL Path10…