Reputation: 1956
I am trying to retrieve the data from a list in share-point 2007 through a web-service written in php as:
<?php
//Authentication details
$authParams = array('login' => 'username', 'password' => 'password' , "authentication" => SOAP_AUTHENTICATION_DIGEST);
/* A string that contains either the display name or the GUID for the list.
* It is recommended that you use the GUID, which must be surrounded by curly
* braces ({}).
*/
$listName = "Testlist";
$rowLimit = '150';
/* Local path to the Lists.asmx WSDL file (localhost). You must first download
* it manually from your SharePoint site (which should be available at
* yoursharepointsite.com/subsite/_vti_bin/Lists.asmx?WSDL)
*/
$wsdl = "http://localhost/phpsp/Lists.wsdl";
//Creating the SOAP client and initializing the GetListItems method parameters
$soapClient = new SoapClient($wsdl, $authParams);
$params = array('listName' => $listName, 'rowLimit' => $rowLimit);
//Calling the GetListItems Web Service
$rawXMLresponse = null;
try{
$rawXMLresponse = $soapClient->GetListItems($params)->GetListItemsResult->any;
}
catch(SoapFault $fault){
echo 'Fault code: '.$fault->faultcode;
echo 'Fault string: '.$fault->faultstring;
}
echo '<pre>' . $rawXMLresponse . '</pre>';
..
..
?>
I have lists created in share-point and in the url, the lists display show '.asmx' extension. How can i manually download the lists and use them as '.wsdl' as done in this sample code.
I searched for the same over the net and people tell it can be obtained at:
sharepoint.url/subsite/_vti_bin/Lists.asmx?WSDL
But, i was not able to get the .wsdl files.
Upvotes: 1
Views: 3123
Reputation: 1697
Please take this wsdl file from http://sharepointserver:port/_vti_bin/Lists.asmx?wsdl
and save the file as listswsdl.wsdl
to your php server in phpsp/listswsdl.wsdl
Lastly, modify this line:
$wsdl = "http://localhost/phpsp/listswsdl.wsdl";
Upvotes: 1