Hi All,
I am trying to access getListItems method of the Lists service of Sharepoint from Flex using WebService.
It is working fine when I omit the query and the viewFields nodes in the request xml. But if I add any query or FieldRef in Viewfields it is throwing error from the service.
Below is the code.
<mx:WebService id="ws2" wsdl="{url}/_vti_bin/Lists.asmx?WSDL" result="ws2result(event)" fault="ws2fault(event)" showBusyCursor="true">
<mx:operation name="GetListItems" resultFormat="e4x">
<mx:request xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>{listId}</listName>
<viewName>{viewId}</viewName>
<ViewFields><FieldRef Name='Locations'/></ViewFields>
</mx:request>
</mx:operation>
</mx:WebService>
It is working fine without the ViewFields.
Can we use the ViewFields and query from flex?
Also is there any way to get the sum of items satisfying a specific condetions using this service?
Applied the new format. But still its throwing error.
The SOAP message captured from fiddler.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<tns:GetListItems xmlns:tns="http://schemas.microsoft.com/sharepoint/soap/"> <tns:listName>{0A1C8CDA-E738-46B7-923D-1D2C599D960F}</tns:listName>
<tns:viewFields>
<tns:Name>ID</tns:Name>
</tns:viewFields>
</tns:GetListItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But the message in the operation tag is passed as below.
<mx:operation name="GetListItems" >
<mx:request xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>\{0A3C3DCA-E744-46C7-916D-1D2C539A960F\}</listName>
<viewFields>
<ViewFields>
<FieldRef Name="ID" />
</ViewFields>
</viewFields>
</mx:request>
</mx:operation>