What do I need to change so the Name node under FieldRef is an attribute of FieldRef, and not a child node?
Suds currently generates the following soap:
<ns0:query>
<ns0:Where>
<ns0:Eq>
<ns0:FieldRef>
<ns0:Name>_ows_ID</ns0:Name>
</ns0:FieldRef>
<ns0:Value>66</ns0:Value>
</ns0:Eq>
</ns0:Where>
</ns0:query>
What I need is this:
<ns0:query>
<ns0:Where>
<ns0:Eq>
<ns0:FieldRef Name="_ows_ID">
</ns0:FieldRef>
<ns0:Value>66</ns0:Value>
</ns0:Eq>
</ns0:Where>
</ns0:query>
The first xml structure is generated by suds from the below code.
q = c.factory.create('GetListItems.query')
q['Where']=InstFactory.object('Where')
q['Where']['Eq']=InstFactory.object('Eq')
q['Where']['Eq']['FieldRef']=InstFactory.object('FieldRef')
q['Where']['Eq']['FieldRef'].Name='_ows_ID'
q['Where']['Eq']['Value']='66'
and print(q)
results in
(query){
Where =
(Where){
Eq =
(Eq){
FieldRef =
(FieldRef){
Name = "_ows_ID"
}
Value = "66"
}
}
}
Here's the code that makes the WS call that creates the soap request
c = client.Client(url='https://community.site.edu/_vti_bin/Lists.asmx?WSDL',
transport=WindowsHttpAuthenticated(username='domain\user',
password='password')
)
ll= c.service.GetListItems(listName="{BD59F6D9-AB4B-474D-BCC7-E4B4BEA7EB27}",
viewName="{407A6AB9-97CF-4E1F-8544-7DD67CEA997B}",
query=q
)