肥皂更新错误Sharepointapi.php

时间:2016-11-10 20:26:33

标签: php sharepoint soap

使用sharepointapi.php将某些值更新为sharepoint列表。我得到了另一个请求XML,由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>
&#13;
&#13;
&#13;

我从服务器上得到了这个:

&#13;
&#13;
<?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>
&#13;
&#13;
&#13;

请注意。我实际上能够从列表中获取所有行。

我的查询格式错误了吗?

三江源。

1 个答案:

答案 0 :(得分:1)

看起来您正在尝试更新列表项的ID。该ID由SharePoint生成,无法更改。