php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62952 Methods from ServerClient cannot be used with ReflectionMethod
Submitted: 2012-08-27 14:36 UTC Modified: 2013-02-18 00:36 UTC
Votes:5
Avg. Score:4.6 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:4 (100.0%)
From: gabriel dot heming at hotmail dot com Assigned:
Status: No Feedback Package: Reflection related
PHP Version: Irrelevant OS: Windows
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-08-27 14:36 UTC] 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...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-19 15:08 UTC] reeze@php.net
-Status: Open +Status: Feedback
 [2012-09-19 15:08 UTC] reeze@php.net
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?
 [2012-09-19 15:14 UTC] reeze@php.net
An extra comma was appended to the url, please try this:

https://gist.github.com/3750131

In short:
" The ReflectionMethod class reports information about a method."
if method didn't exists an exception was thrown when construct ReflectionMethod.
 [2013-02-18 00:36 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 15:01:30 2024 UTC