Reputation: 1
Using sharepointapi.php in order to update some value into a sharepoint list. I get the next request XML, generated by sharepointapi.php:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/sharepoint/soap/">
<SOAP-ENV:Body>
<UpdateListItems xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>CONTRACTS</listName>
<updates>
<Batch ListVersion="1" OnError="Continue">
<Method Cmd="Update" ID="1">
<Field Name="state">Awaiting F</Field>
<Field Name="ID">10</Field>
</Method>
</Batch>
</updates>
</UpdateListItems>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
And I got this from the server:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body><soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.</faultstring>
<detail>
<errorstring xmlns="http://schemas.microsoft.com/sharepoint/soap/">Cannot access a closed Stream.
</errorstring>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
Note. I am actually able to get all the rows from the list.
Is my query bad formatted?
Thankyou.
Upvotes: 0
Views: 154
Reputation: 11
Looks like your trying to update the ID of a listitem. The ID is generated by SharePoint and cannot be changed.
Upvotes: 1