Bug #62952 [Opn->Fbk]: Methods from ServerClient cannot be used with ReflectionMethod
| From: | reeze@php.net | Date: | Wed, 19 Sep 2012 15:08:05 +0000 |
| Subject: | Bug #62952 [Opn->Fbk]: Methods from ServerClient cannot be used with ReflectionMethod | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-173569@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62952&edit=1
ID: 62952
Updated by: reeze@php.net
Reported by: gabriel dot heming at hotmail dot com
Summary: Methods from ServerClient cannot be used with
ReflectionMethod
-Status: Open
+Status: Feedback
Type: Bug
Package: Reflection related
Operating System: Windows
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Hi,
since call methods from a webservice like $client->method($args) is
a proxy method, it didn't exist in Soapclient, it use the magic method
Soapclient::__call() to the really work, so th method didn't exist at all
see: https://gist.github.com/3750131, it should been
a fatal error complain
method didn't exists.
could you please try the test script from the gist above?
Previous Comments:
------------------------------------------------------------------------
[2012-08-27 14:36:53] gabriel dot heming at hotmail dot com
Description:
------------
Well, I'm trying reflect a client of web service. When I use call_user_func_array
it works fine. But when I use ReflectionMethod, doesn't work. Is better you see:
Test script:
---------------
My variables:
$client = new SoapClient('http://localhost/webservice?wsdl');
$method = 'someMethod';
arguments = array('argument one' , 'argument two');
This code work fine:
return call_user_func_array(array($client , $method) , $arguments);
This code doesn't work
$reflectionMethod = new ReflectionMethod($client , $method);
return $reflectionMethod->invokeArgs($client , $arguments);
Expected result:
----------------
Return of function from ServerClient.
Actual result:
--------------
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML
document in...
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62952&edit=1