php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53068 Soap header object without attributes
Submitted: 2010-10-14 18:04 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: goetas at lignano dot it Assigned:
Status: Open Package: SOAP related
PHP Version: 5.3.3 OS: Ubuntu
Private report: No CVE-ID: None
 [2010-10-14 18:04 UTC] goetas at lignano dot it
Description:
------------
when soap server handles the soap header, the object version of the header does not contain it's attributes.


Test script:
---------------
server
<?php
class testSoap{
	protected $auth;
	public function login($data){
		$this->auth=print_r($data,1);
	}
	public function getLogin(){
		return $this->auth;
	}
}

$server = new SoapServer('test.wsdl', array('cache_wsdl'=>WSDL_CACHE_NONE));
$server->setObject(new testSoap());
$server->handle();
?>
client
<?php
$cl = new SoapClient('http://sviluppo.netanday.it/wsdltest/test.wsdl',
	 array('cache_wsdl'=>WSDL_CACHE_NONE, 'trace'=>true)
);

$xml = "<gs:login xmlns:gs=\"http://www.goetas.com\"><logdata name='user' password='pwd' /></gs:login>";

$cl->__setSoapHeaders(array(new SoapHeader('http://www.goetas.com', 'login', new \SoapVar($xml, XSD_ANYXML))));

echo $cl->getLogin();

?>


Expected result:
----------------
stdClass Object
(
    [logdata] => stdClass Object
    (
        [name] => user
        [password] => pwd 
    )
)



Actual result:
--------------
stdClass Object
(
    [logdata] => 
)

Patches

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 02:01:27 2024 UTC