I have a problem regarding soap and headers. I am running Apache 2.0.55 and PHP 5.1.1 on WinXP and my code is as follows:
// Create the soap client
$url = 'http://www.bogus.com/';
$soapClient = new SoapClient ($url.'Security.asmx?WSDL', array ('exceptions' => 0, 'encoding' => 'ISO-8859-1', 'trace' => 1));
$arr1 = array('UserName' => 'pst', 'MerchantNumbers' => array(8206,8273));
$arr2 = array('loginData' => $arr1);
// Make a request
$result = $soapClient->Login ($arr2);
// Create a soap header
$userId = new SoapVar($result->LoginResult->UserId, XSD_INTEGER,'UserId');
$soapHeader = new SoapHeader($url, "WBAHeader", $userId, false);
$soapClient->__setSoapHeaders(array($soapHeader));
// Make another request
$result = $soapClient->GetAllUsers ();
My problem is that the second soap call makes Apache crash. Is there an obvious error in my code that I am missing? Has anyone else experienced the same problem?
Any help appreciated.