微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

即使没有注释扩展,PHP Soap Client也会丢失

如何解决即使没有注释扩展,PHP Soap Client也会丢失

我正在使用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.dllC://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列表。

链接
SharePointAPIhttps://github.com/thybag/PHP-SharePoint-Lists-API
nuSOAPhttps://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);
}

我使用nuSOAP来获取WSDL的代码

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 举报,一经查实,本站将立刻删除。