Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP SOAP调用失败,标头发送问题_Php_Soap - Fatal编程技术网

PHP SOAP调用失败,标头发送问题

PHP SOAP调用失败,标头发送问题,php,soap,Php,Soap,我需要使用值1234进行soap调用“GetCommitQueueData” 我需要进行身份验证以绕过HTTP身份验证 我还需要在标题中传递用户名、密码和id,但每次它告诉我id不发送时,下面是我的代码,也许有人可以帮助: $username = 'myuser'; $password = 'mypass'; $idi = "3445-343534-453453-343-344"; ini_set('soap.wsdl_cache_enabled', false); $client = n

我需要使用值1234进行soap调用“GetCommitQueueData” 我需要进行身份验证以绕过HTTP身份验证 我还需要在标题中传递用户名、密码和id,但每次它告诉我id不发送时,下面是我的代码,也许有人可以帮助:

$username = 'myuser';
$password = 'mypass';  
$idi = "3445-343534-453453-343-344"; 
ini_set('soap.wsdl_cache_enabled', false);
$client = new SoapClient("https://localhost.com/myfile.wsdl", array('trace' => 1, 'login'    => 'myuser',
        'password' => 'mypass', 'Request-Id' => $idi));



$ns = 'http://foreignhost.com/AdminAPI_Admin'; //Namespace of the WS. 

//Body of the Soap Header. 
$headerbody = array('UserName' => $username, 
                    'Password' => $password, 
                    'Request-Id'=>$idi); 

$header = new SOAPHeader($ns, 'RequestorCredentials', $headerbody);        

$client->__setSoapHeaders($header); 


show($client->__getFunctions()); 

$info = $client->__soapCall("GetCommitQueueData", array('1234' ));
show($info); 



function show($data){
    echo "<pre>";
    print_r($data); 
    echo "</pre>";
}
$username='myuser';
$password='mypass';
$idi=“3445-343534-453453-343-344”;
ini_集('soap.wsdl_缓存已启用',false);
$client=新的SoapClient(“https://localhost.com/myfile.wsdl,数组('trace'=>1,'login'=>myuser',
'密码'=>'我的通行证','请求Id'=>$idi));
$ns=http://foreignhost.com/AdminAPI_Admin'; //WS的名称空间。
//Soap头的主体。
$headerbody=数组('UserName'=>$UserName,
“密码”=>$Password,
“请求Id”=>$idi);
$header=新的SOAPHeader($ns,'RequestorCredentials',$headerbody);
$client->uu setSoapHeaders($header);
显示($client->_getFunctions());
$info=$client->\uuuuSOAPCALL(“GetCommitQueueData”,数组('1234');
显示($info);
功能显示($data){
回声“;
打印(数据);
回声“;
}
我得到这个错误:

致命错误:未捕获的SoapFault异常:[a:InternalServiceFault]标头中缺少请求Id

如果nusoap有更简单的解决方案,请告诉我