PHP使用Thybag \ SharePointAPI连接到Sharepoint

时间:2014-02-27 14:47:35

标签: php sharepoint

我有以下代码

//$sp = new SharePointAPI('&&', '&&', 'https://&&.net/personal/zzz/_vti_bin/Lists.asmx?WSDL',);

//$sp = new SharePointAPI('&&', '&&', 'https://&&net/personal/zzz/_vti_bin/Lists.asmx?SDL', 'NTLM');

$sp = new SharePointAPI('&&', '&&', 'https://&&net/personal/zzz/_vti_bin/Lists.asmx?WSDL', 'SPONLINE');

$listContents = $sp->read('GetListCollection'); 

return $listContents;

根据我执行的“新SharepointAPI”行,我得到了不同的错误。

使用“NTLM”,我收到错误: -

Uncaught exception 'Exception' with message 'Error'  
in /home/shinksyc/public_html/sharepointUpload/src/Thybag/Auth/SoapClientAuth.php:129
Stack trace:
#0 [internal function]: Thybag\Auth\SoapClientAuth->__doRequest('<?xml 
version="...', 'https://my.sp.m...', 'http://schemas....', 1, 0)

使用“SPONLINE”,我收到错误

'Error (Client) looks like we got no XML document'.

关于如何找出列表的名称,我也有点困惑。

非常感谢任何帮助。

由于

马丁

1 个答案:

答案 0 :(得分:1)

xml的路径必须是本地的:要清除,请登录到您的sharepoint,转到网址https://mySPsite/subsite/_vti_bin/Lists.asmx?WSDL 下载XML并将其放在PHP服务器上。 那么

$sp = new SharePointAPI($login, $password, $localPathToWSDL, 'NTLM');