我正在尝试通过用 php 编写的 web 服务从 share-point 2007 中的列表中检索数据:
<?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>';
..
..
?>
我在共享点和 url 中创建了列表,列表显示显示“.asmx”扩展名。我如何手动下载列表并将它们用作“.wsdl”,如本示例代码中所做的那样。
我在网上搜索了相同的内容,人们告诉它可以在以下位置获得:
sharepoint.url/subsite/_vti_bin/Lists.asmx?WSDL
但是,我无法获得 .wsdl 文件。