Bug #49530 [Opn->Fbk]: SOAP header only results in function call when document/literal
| From: | dmitry@php.net | Date: | Fri, 28 May 2010 11:43:09 +0000 |
| Subject: | Bug #49530 [Opn->Fbk]: SOAP header only results in function call when document/literal | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150905@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=49530&edit=1
ID: 49530
Updated by: dmitry@php.net
Reported by: sjoerd-php at linuxonly dot nl
Summary: SOAP header only results in function call when
document/literal
-Status: Open
+Status: Feedback
Type: Bug
Package: SOAP related
Operating System: *
PHP Version: 5.3.0
-Assigned To:
+Assigned To: dmitry
New Comment:
Both WSDLs work fine for me except for commented <import> line. The
client:
<?php
$cl = new SoapClient(dirname(__FILE__).'/bug49530_2.wsdl',
array('cache_wsdl'=>WSDL_CACHE_NONE, 'trace'=>true));
$cl->__setSoapHeaders(array(new
SoapHeader('http://www.myservice.nl/soap/',
'HeaderAuthenticate',
array('reactid'=>'test'))));
$ret = $cl->login('user', 'pass');
echo $ret . PHP_EOL;
echo $cl->__getLastRequest();
echo $cl->__getLastResponse();
?>
Previous Comments:
------------------------------------------------------------------------
[2009-09-11 12:20:45] sjoerd-php at linuxonly dot nl
Description:
------------
When a SOAP header is sent to a webservice which uses SoapServer, a
method with the same name as the header is called. However, this only
happens when the webservice is document/literal, not when it is
rpc/encoded.
Reproduce code:
---------------
<?php
class SoapHandler
{
function HeaderAuthenticate($header)
{
header("X-Debug: header was called");
}
function login()
{ }
}
if ($_GET['doclit']) {
$wsdl = 'doclit.wsdl'; // http://pastebin.com/f7b1434d9
} else {
$wsdl = 'rpcencoded.wsdl'; // http://pastebin.com/fe989844
}
$handler = new SoapHandler();
$server = new SoapServer($wsdl);
$server->setObject($handler);
$server->handle();
?>
Expected result:
----------------
With both WSDLs, that the HeaderAuthenticate method is called. That is,
the X-Debug header contains "header was called" when the
HeaderAuthenticate header was sent.
Actual result:
--------------
The HeaderAuthenticate method is only called with document/literal WSDL.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=49530&edit=1