ID: 31817
User updated by: tschlottke at virtualminds dot de
Reported By: tschlottke at virtualminds dot de
Status: Open
Bug Type: SOAP related
Operating System: debian unstable
PHP Version: 5.0.3
Assigned To: dmitry
New Comment:
or am I wrong and you ment that I should call another
function but not test()?
this isn't working in my php 5.0.3 installation and that's
why i submitted the bug ;)
Previous Comments:
------------------------------------------------------------------------
[2005-02-04 15:42:41] tschlottke at virtualminds dot de
Yes, that's not what I ment.
Sure, __call is being called if I call another method from
within test() but __call should also be called if a not
existing method is being called via soap, IMHO, you know
what I mean?
This is very useful if you want to wrap all soap calls and
check the parameters, for example, so you can create
completly virtual soap methods.
In my case I use this to check if the session is valid.
The user always has to send the session-id as the first
parameter for each function and __call checks if
everything is correct and calls all the target-method via
call_user_function_array() or something.
------------------------------------------------------------------------
[2005-02-04 15:29:27] [EMAIL PROTECTED]
It works as expected.
If you will call somthing different from "test" you will go into
__call().
------------------------------------------------------------------------
[2005-02-02 16:40:44] tschlottke at virtualminds dot de
Description:
------------
PHP 5's magic __call() method is being ignored in classes
exported via soap.
It's being ignored completly, afais.
IMHO it should be called.
Reproduce code:
---------------
<?php
class test {
function __call($func,$args) {
return 'this is __call()';
}
function test(){
return 'this is test()';
}
}
$server = new SoapServer(null, array('uri' => "namespace"));
$server->setClass('test');
$server->handle();
?>
---
<?php
$client=new SoapClient(...);
echo $client->test();
?>
Expected result:
----------------
"this is __call"
Actual result:
--------------
"this is test()"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31817&edit=1