我习惯为SOAP调用编写PHP代码 这是我的代码
<?php
$client = new SoapClient("http://www.fma.fr/webservices_comparateurs/tarification_sante_comparateurs.asmx?wsdl");
$param = array('NomUtilisateur' => 'XXXXXX','MotDePasse' => 'XXYYZZ','ContenuDuMessage' => '');
$values = $client->TariferSante($param);
var_dump($values);
?>
object(stdClass)#2(1){[“TariferSanteResult”] =&gt;串(109) “err_authentification”}
使用的参数为true,您可以尝试使用此链接: http://www.fma.fr/webservices_comparateurs/tarification_sante_comparateurs.asmx?op=TariferSante
答案 0 :(得分:0)
更新答案: 我尝试了这段代码并且有效
$options = array(
'uri'=>'http://schemas.xmlsoap.org/soap/envelope/',
'style'=>SOAP_RPC,
'use'=>SOAP_ENCODED,
'soap_version'=>SOAP_1_1,
'cache_wsdl'=>WSDL_CACHE_NONE,
'connection_timeout'=>15,
'trace'=>true,
'encoding'=>'UTF-8',
'exceptions'=>true,
);
class TariferSante {
public $nomUtilisateur;
public $motDePasse;
public $contenuDuMessage;
}
$client = new SoapClient("http://www.fma.fr/webservices_comparateurs/tarification_sante_comparateurs.asmx?wsdl",$options);
$param = new TariferSante();
$param->nomUtilisateur = "XXXXXXX";
$param->motDePasse = "XXYYZZ";
$param->contenuDuMessage = "";
$values = $client->TariferSante($param);
echo "Request".htmlspecialchars($client->__getLastRequest());
var_dump($values);
答案 1 :(得分:0)
我和Teradata Soap有同样的问题,我认为它需要基本授权而不是http - 我的解决方案是:
$opts = array();
$opts['login'] = 'username';
$opts['password'] = 'secretpassword';
$opts['trace'] = 1;
$opts['authentication'] = SOAP_AUTHENTICATION_BASIC;
$url = "https://example.com/vx?wsdl";
$client = new SoapClient($url, $opts);
我得到了它。
点击此处查看我的讨论:Soap Header with Authorization Basic in native PHP