未捕获的SoapFault异常:[客户端]在以下请求标头中找不到用户名和密码

时间:2018-06-20 07:04:18

标签: php soap

这是我的代码:

$username = 'xxx';
$password = 'xxx';
$soapURL="my_url?wsdl";
$ns = 'my_url';
//Namespace of the WS.
//Body of the Soap Header. 
$headerbody=array('UsernameToken'=>array('Username'=>$username,'Password' => $password ));
//Create Soap Header. 
$client=new SoapClient($soapURL,array());      
$header = new SOAPHeader($ns, 'authentication', $headerbody);       
//set the Headers of Soap Client.
$client->__setSoapHeaders($header);
$data=array("Gender"=>"m", "ProspectType"=>"abc", "TariffProfile"=>"test"); 
$response = $client->__soapCall("myfunction",$data);
echo "<pre>";var_dump($response);

你能告诉我其中有什么问题吗?

0 个答案:

没有答案
相关问题