NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
duplication of records in Shrapoint


Joined: 03 Nov 2011
Posts: 2
Reply with quote
Hi.
Sharepoint server with ntlm authorization. The request is successful, but added to the list is not one but 3 identical records with different ID

Code:

<?php
require_once('lib/nusoap.php');

$username = 'username';
$password = 'password';
$listName = "name";
$wsdl = "http://url/_vti_bin/Lists.asmx?WSDL";


$client = new nusoap_client($wsdl, true);

$client->setCredentials($username,$password, "ntlm");
$client->useHTTPPersistentConnection();
$client->soap_defencoding='UTF-8';

$arrData = array(
                "Title"=>"title",
            "Priority"=>"normal",
            "Status"=>"start",
            "PercentComplete"=>"0",
            "Body"=>"test",
            );
$items = '';
 foreach($arrData AS $itm => $val){
       $items .= "<Field Name='{$itm}'>{$val}</Field>\n";
}


$CAML ="<UpdateListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'>
                         <listName>{$listName}</listName>
                         <updates>
                                 <Batch ListVersion='1' OnError='Continue'>
                                         <Method Cmd='New' ID='1'>
                                                {$items}
                                         </Method>
                                 </Batch>
                         </updates>
               </UpdateListItems>";

$result = $client->call('UpdateListItems', $CAML,"","http://schemas.microsoft.com/sharepoint/soap/UpdateListItems");


if(isset($fault)) {
  echo("<h2>Error</h2>". $fault);
}

$responseContent = htmlspecialchars(substr($client->response,strpos($client->response, "<"),strlen($client->response)-1));

echo "<h2>Request</h2><pre>" . $client->request . "</pre><br>";
echo "<h2>Response header</h2><pre>" . $client->response . "</pre><br>";
echo "<h2>Response content</h2><pre>".$responseContent."</pre><br>";

unset($client);


PS Sorry for my english.
View user's profileFind all posts by Kyrt_GodSend private message


Joined: 03 Nov 2011
Posts: 2
Reply with quote
the problem is solved
Code:

...
unset($client);
header("Location: $url");
View user's profileFind all posts by Kyrt_GodSend private message
duplication of records in Shrapoint
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic