From: bink at eezi dot net dot au Operating system: Redhat PHP version: 5.2.0 PHP Bug Type: SOAP related Bug description: SOAP_ENC_OBJECT does not encode object properties with namespace
Description: ------------ Possibly a documentation issue ===================================== When using a php object to create SOAP request headers, the SoapVAR($obj, SOAP_ENC_OBJECT....) and SoapHeader($namespace, $name, $soapvar) does not set the namespace of the object properties to the same as the object itself. Reproduce code: --------------- $client = new SOAPClient($wsdl, array('trace' => '1')); class headers { function __construct($val1, $val2){ $this->val1 = $val1; $this->val2 = $val2; } } $obj = new headers('val1','val2'); $svval=new SoapVar($obj,SOAP_ENC_OBJECT, NULL, NULL, "", "http://url.com/namespace2"); $header = new SoapHeader("http://url.com/namespace2", "SoapHeaderMsg", $svval, false); $client->__setSoapHeaders(array($header)); $client->ping(); print_r($client->__getLastRequest()); Expected result: ---------------- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://url.com/namespace1" xmlns:ns2="http://url.com/namespace2"> <SOAP-ENV:Header> <ns2:SoapHeaderMsg> <ns2:val1>val1</val1> <ns2:val2>val2</val2> </ns2:SoapHeaderMsg> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns1:PingRequest/> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Actual result: -------------- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ow.optus.com.au/b2b/bwsgservices/schema/version/2.0/bilpm" xmlns:ns2="http://ow.optus.com.au/b2b/xwsgservices/schema/wscommon"> <SOAP-ENV:Header> <ns2:SoapHeaderMsg> <val1>val1</val1> <val2>val2</val2> </ns2:SoapHeaderMsg> </SOAP-ENV:Header> <SOAP-ENV:Body> <ns1:PingRequest/> </SOAP-ENV:Body> </SOAP-ENV:Envelope> -- Edit bug report at http://bugs.php.net/?id=40318&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40318&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40318&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40318&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40318&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40318&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40318&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40318&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40318&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40318&r=support Expected behavior: http://bugs.php.net/fix.php?id=40318&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40318&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40318&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40318&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40318&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40318&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40318&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40318&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40318&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40318&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40318&r=mysqlcfg