note 89956 modified in soapclient.setsoapheaders by danbrown

From: Date: Mon, 30 Mar 2009 21:09:59 +0000
Subject: note 89956 modified in soapclient.setsoapheaders by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-152630@lists.php.net to get a copy of this message
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 // first soap header. $var = new SoapVar($header, XSD_ANYXML); $soapHeader = new SoapHeader(NAME_SPACE, "Security", $var); // second soap header. $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; // Here my code was just terminating. $client->__setSoapHeaders($headers); ?> --was-- 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: // first soap header. $var = new SoapVar($header, XSD_ANYXML); $soapHeader = new SoapHeader(NAME_SPACE, "Security", $var); // second soap header. $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; // Here my code was just terminating. $client->__setSoapHeaders($headers); http://php.net/manual/en/soapclient.setsoapheaders.php

« previous php.notes (#152630) next »