Php Sharepoint service web服务问题:未经授权

Php Sharepoint service web服务问题:未经授权,php,sharepoint,iis,Php,Sharepoint,Iis,全部 我是一名博士,不熟悉sharepoint。 我现在正在使用php和sharepoint Services 2.0的文件存储服务开发一个网站 通过在IIS中启用匿名身份验证,可以毫无问题地访问web服务本身。 这是我的问题。调试代码时,我不断收到“Unauthorized”错误。 异常消息如下所示 SoapFault Object ( [message:protected] => Unauthorized [string:Exception:private] =>

全部 我是一名博士,不熟悉sharepoint。 我现在正在使用php和sharepoint Services 2.0的文件存储服务开发一个网站 通过在IIS中启用匿名身份验证,可以毫无问题地访问web服务本身。 这是我的问题。调试代码时,我不断收到“Unauthorized”错误。 异常消息如下所示

SoapFault Object ( [message:protected] => Unauthorized [string:Exception:private] => [code:protected] => 0 [file:protected] => /var/www/snippet/wsdl/index.php [line:protected] => 12 [trace:Exception:private] => Array ( [0] => Array ( [function] => __doRequest [class] => SoapClient [type] => -> [args] => Array ( [0] => Issue [1] => http://192.168.56.101/sites/SPS2003/_vti_bin/Lists.asmx [2] => http://schemas.microsoft.com/sharepoint/soap/GetList [3] => 1 [4] => 0 ) ) [1] => Array ( [file] => /var/www/snippet/wsdl/index.php [line] => 12 [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => GetList [1] => Array ( [0] => Array ( [listName] => Issue ) ) ) ) [2] => Array ( [file] => /var/www/snippet/wsdl/index.php [line] => 12 [function] => GetList [class] => SoapClient [type] => -> [args] => Array ( [0] => Array ( [listName] => Issue ) ) ) ) [previous:Exception:private] => [faultstring] => Unauthorized [faultcode] => HTTP [xdebug_message] => SoapFault: Unauthorized in /var/www/snippet/wsdl/index.php on line 12 Call Stack: 0.0004 637376 1. {main}() /var/www/snippet/wsdl/index.php:0 0.0006 758992 2. SoapClient->GetList(array(1)) /var/www/snippet/wsdl/index.php:12 ) SoapFault对象 ( [消息:受保护]=>未经授权 [字符串:异常:私有]=> [代码:受保护]=>0 [文件:受保护]=>/var/www/snippet/wsdl/index.php [线路:受保护]=>12 [跟踪:异常:专用]=>数组 ( [0]=>阵列 ( [功能]=>\uuu-doRequest [class]=>SoapClient [类型]=>-> [args]=>数组 ( [0] => 问题 [1] => http://192.168.56.101/sites/SPS2003/_vti_bin/Lists.asmx [2] => http://schemas.microsoft.com/sharepoint/soap/GetList [3] => 1 [4] => 0 ) ) [1] =>阵列 ( [文件]=>/var/www/snippet/wsdl/index.php [行]=>12 [函数]=>\u调用 [class]=>SoapClient [类型]=>-> [args]=>数组 ( [0]=>GetList [1] =>阵列 ( [0]=>阵列 ( [listName]=>问题 ) ) ) ) [2] =>阵列 ( [文件]=>/var/www/snippet/wsdl/index.php [行]=>12 [函数]=>GetList [class]=>SoapClient [类型]=>-> [args]=>数组 ( [0]=>阵列 ( [listName]=>问题 ) ) ) ) [上一个:例外:私有]=> [faultstring]=>未经授权 [faultcode]=>HTTP [xdebug_消息]=> SoapFault:12行的/var/www/snippet/wsdl/index.php中未经授权 调用堆栈: 0.0004 637376 1.{main}()/var/www/snippet/wsdl/index.php:0 0.0006 758992 2.SoapClient->GetList(数组(1))/var/www/snippet/wsdl/index.php:12 ) 我的代码片段是这样的

$client = new SoapClient("http://192.168.56.101/sites/SPS2003/_vti_bin/Lists.asmx?wsdl"); try{ $result = $client->GetList(array("listName" => "Issue")); } catch(Exception $e){ print_r($e); } $client=新的SoapClient(“http://192.168.56.101/sites/SPS2003/_vti_bin/Lists.asmx?wsdl"); 试一试{ $result=$client->GetList(数组(“listName”=>“问题”); } 捕获(例外$e){ 印刷品(港币);; } 这可能是IIS配置的错误吗? 我正在使用sharepoint Services 2.0和sharepoint portal server 2003。 有人能帮我吗


提前感谢。

您在调用SharePoint Web服务时是否传递了有效凭据


看看这个样品。这可能对你有帮助。

好的,我终于找到了解决办法。 我需要做的就是在IIS中启用“基本身份验证”。它位于IIS中目录的安全设置中。 现在,我可以访问sharepoint web服务,而不会出现权限问题。
希望这能帮助一些人遇到这样的麻烦。

是的。我尝试过在新的SoapClient中使用auth_参数,得到了“http401unauthorized”错误。然后,我更改了启用匿名身份验证的IIS设置。结果如上。也许我应该再试一次。还是谢谢你。