With multiple SOAP headers, when using SoapVar for creation of SoapHeader the PHP code just terminates (command terminated). I am not sure if that is a bug.
Without the SOAPVar the code worked fine for me
There are different way to creart SoapHeader I was using SoapVar and the code was not working. I am still a novice with this SOAP stuff.
Tried using normal strings and it worked fine. SoapHeader can take SoapVar or string as the third argument.
my code:
<?php
$var = new SoapVar($header, XSD_ANYXML);
$soapHeader = new SoapHeader(NAME_SPACE, "Security", $var);
$var2 = new SoapVar($header2, XSD_ANYXML);
$soapHeader2 = new SoapHeader(DIFF_NAME_SPACE, "ID", $var2);
$client = new SoapClient($wsdl, array("location" => $location));
$headers = array();
$headers[] = $soapHeader;
$headers[] = $soapHeader2;
$client->__setSoapHeaders($headers);
?>