问题描述
我正在使用SharePointAPI
,而我试图通过WSDL
来获取SharePoint
中的PHP
来阅读和编辑列表。
最初,SoapClient似乎没有与SharepointAPI正确交互,但是我意识到,仅靠SoapClient来获取任何WSDL的任何尝试都是不可能的。
我总是遇到相同的错误:
致命错误:未捕获异常:无法找到WSDL文件。 faultcode = 0,faultstring = SOAP-ERROR:解析WSDL:无法从中加载 'https://spar.sharepoint.com/sites/ICSHWOrder/_vti_bin/Lists.asmx?WSDL' :无法加载外部实体 “ https://spar.sharepoint.com/sites/ICSHWOrder/_vti_bin/Lists.asmx?WSDL” 在 C:\ xampp \ htdocs \ PHPSpreadsheet-Artikelkatalog \ PHP_script \ lib \ Sharepoint \ src \ Thybag \ SharePointAPI.PHP:193 堆栈跟踪: #0 C:\ xampp \ htdocs \ PHPSpreadsheet-Artikelkatalog \ PHP_script \ test.PHP(15): Thybag \ SharePointAPI-> __ construct('',``, 'https://spar.sh ...')#1 {main}被抛出 C:\ xampp \ htdocs \ PHPSpreadsheet-Artikelkatalog \ PHP_script \ lib \ Sharepoint \ src \ Thybag \ SharePointAPI.PHP在第193行
在第181行出现问题之后,错误在第185行的文件中引发了错误:
https://github.com/thybag/PHP-SharePoint-Lists-API/blob/develop/src/Thybag/SharePointAPI.php
我用一系列echo
的
我已经extension=soap
中的extension=PHP_openssl.dll
和C://xampp/PHP/PHP.ini
中取消了注释(当然,在我的C://PHP7/PHP.ini
中也没有注释)
我还尝试过单独使用nuSOAP
来获取WSDL
并获得一个
通知
Notice: Array to string conversion in C:\xampp\htdocs\PHPSpreadsheet-Artikelkatalog\PHP_script\lib\nuSOAP\lib\nusoap.PHP on line 7266
该通知位于“ //HERE
”行
function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false,$proxypassword = false,$timeout = 0,$response_timeout = 30,$portName = ''){
parent::nusoap_base();
$this->endpoint = $endpoint;
$this->proxyhost = $proxyhost;
$this->proxyport = $proxyport;
$this->proxyusername = $proxyusername;
$this->proxypassword = $proxypassword;
$this->timeout = $timeout;
$this->response_timeout = $response_timeout;
$this->portName = $portName;
$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); //HERE
$this->appendDebug('endpoint=' . $this->varDump($endpoint));
// make values
if($wsdl){
if (is_object($endpoint) && (get_class($endpoint) == 'wsdl')) {
$this->wsdl = $endpoint;
$this->endpoint = $this->wsdl->wsdl;
$this->wsdlFile = $this->endpoint;
$this->debug('existing wsdl instance created from ' . $this->endpoint);
$this->checkWSDL();
} else {
$this->wsdlFile = $this->endpoint;
$this->wsdl = null;
$this->debug('will use lazy evaluation of wsdl from ' . $this->endpoint);
}
$this->endpointType = 'wsdl';
} else {
$this->debug("instantiate SOAP with endpoint at $endpoint");
$this->endpointType = 'soap';
}
}
我只希望能够编辑我的SharePoint列表。
链接:SharePointAPI
:https://github.com/thybag/PHP-SharePoint-Lists-API nuSOAP
:https://sourceforge.net/projects/nusoap/
信息:XAMPP
版本:v3.2.4
已编译Jun 5th 2019
PHP
版本:7.4.9
建立日期:Aug 4 2020 11:45:36
我使用SharePointAPI的代码:
include('./lib/Sharepoint/SharePointAPI.PHP');
use Thybag\SharePointAPI;
$sp = new SharePointAPI("<username>","<password>","https://spar.sharepoint.com/sites/ICSHWOrder/_vti_bin/Lists.asmx?WSDL");
$listContents = $sp->read('Bestellungen');
foreach($listContents as $item)
{
var_dump($item);
}
include("lib/nuSOAP/lib/nusoap.PHP");
$options = array("trace"=>true,"exceptions"=> true,"keep_alive"=> false,"soap_version"=> 1,"cache_wsdl"=> 1,"compression"=> 0,"encoding"=>"UTF-8","login"=>"<username>","password"=>"<password>" );
$soapClient = new nusoap_client('https://spar.sharepoint.com/sites/ICSHWOrder/_vti_bin/Lists.asmx?WSDL',$options);
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)