2012-11-21 51 views
0

我執行我的web服務文件下面讓SharePoint列表中的數據:網絡服務來獲取SharePoint數據給出錯誤

$authParams = array('login' => 'user', 'password' => 'pass'); 

/* 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 = "TestList1"; 
$rowLimit = '150'; 

$wsdl = "http://192.168.1.197:5000/sharepoint/ListsWSDL.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; 
} 

但它會進入catch塊與以下錯誤:

Fault code: HTTPFault string: Not Found 

是什麼問題。提前致謝。

回答

0

嘗試http://[sharepoint site url]/_vti_bin/lists.asmx?WSDL爲WSDL,

http://[sharepoint site url]/_vti_bin/lists.asmx

list of webservices存在實際的Web服務具有顯示每個服務的URL的網頁。

+0

我只生成了wsdl文件,並將其存儲在本地/ sharepoint文件夾中 – clint

+0

您仍然需要使用正確的url調用webservice,否則您將收到404響應。 – Nat

+0

路徑'http://192.168.1.197:5000/sharepoint/ListsWSDL.wsdl'是存儲生成的wsdl文件的本地文件夾的路徑。這就是我所說的。 – clint