I want to fetch a video from SharePoint and am using this API. It actually asks for WSDL file. I got WSDL
file from this link https://mysite.sharepoint.com/_vti_bin/Lists.asmx?WSDL (Replacing mysite
with actual URL for security reasons). I am using the code below
<?php
include "src\Thybag\SharePointAPI.php";
include "src\Thybag\Auth\SharePointOnlineAuth.php";
include "src\Thybag\Auth\SoapClientAuth.php";
include "src\Thybag\Auth\StreamWrapperHttpAuth.php";
include "src\Thybag\Service\ListService.php";
include "src\Thybag\Service\QueryObjectService.php";
use Thybag\SharePointAPI;
$sp = new SharePointAPI('username','password',' https://mysite.sharepoint.com/_vti_bin/Lists.asmx?WSDL','SPONLINE');
$data = $sp->read('Documents');
var_dump($data);
//phpinfo();
?>
I am following this error
Fatal error: Uncaught Exception: Error (soap:Server) Exception of type 'Microsoft.SharePoint.SoapServer.SoapServerException' was thrown.,more=Detailed: List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user. in C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php:1016 Stack trace: #0 C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php(446): Thybag\SharePointAPI->onError(Object(SoapFault)) #1 C:\xampp\htdocs\sharepoint\zain.php(10): Thybag\SharePointAPI->read('Documents') #2 {main} thrown in C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php on line 1016
It actually says that List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.
which I have really no idea that how to deal with this. I actually don't know that how to make new WSDL file in Sharepoint
If I use these credentials
$sp = new SharePointAPI('username','password','https://mysite.sharepoint.com/sites/ObjectifiedWIP/_vti_bin/Lists.asmx?WSDL');
then It gives me this error
Fatal error: Uncaught Exception: Error (HTTP) Forbidden,more= in C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php:1016 Stack trace: #0 C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php(446): Thybag\SharePointAPI->onError(Object(SoapFault)) #1 C:\xampp\htdocs\sharepoint\zain.php(10): Thybag\SharePointAPI->read('Documents') #2 {main} thrown in C:\xampp\htdocs\sharepoint\src\Thybag\SharePointAPI.php on line 1016
I really don't know that how to tackle them. Thanks