SoapClient不工作给出错误



我使用soap调用请求到下面的URL使用PHP SoapClient

https://stagingxml.tamarindtours.in/Version1.0/BaseDetails.svc?wsdl

我使用了以下代码:

$HeaderSecurity = array("UsernameToken"=>array("Username"=>"xxx",
                                          "Password"=>"xxx",
                                )
);
$client = new SoapClient('https://stagingxml.tamarindtours.in/Version1.0/BaseDetails.svc?wsdl',array('trace' => 1));
$header[] = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd","Security",$HeaderSecurity);
$client->__setSoapHeaders($header);
//$client->__setLocation("https://YourTargetLocation/"); if you have wsdl file you don't need to use this line 
$REsponse = $client->GetCountries();

我得到以下错误。

Fatal error: Uncaught SoapFault exception: [a:InvalidSecurity验证邮件安全性时发生错误。在/opt/lampp/htdocs/wssoap.php:148/opt/lampp/根/wssoap.php (148): SoapClient -> __call("GetCountries",#1/opt/lamp/htdocs/wssoap.php(148)SoapClient->GetCountries() #2 {main}抛出/opt/lampp/htdocs/wssoap.php on line 148

你能帮帮我吗?谢谢。

服务器可能有一个无效的SSL证书。

如果此错误对您不重要,请尝试忽略SSL证书检查,如下所示:https://stackoverflow.com/a/8447706/911718(参见关于allow_self_signed选项的评论)

编辑:和你一样的错误&错误解决https://stackoverflow.com/a/16794759/911718

相关内容

  • 没有找到相关文章

最新更新