You are here: Overriding __soapCall « PHP « IT news, forums, messages
Overriding __soapCall

Posted by Marcus Bointon on 07/14/05 18:07

I'm working on a soap client in PHP5, which I'm building by
subclassing the built-in SoapClient class. However, it seems my
overridden __soapCall method is never being called. My class looks
something like this:

class myClient extends SoapClient {
public function __construct($wsdl = 'http://www.example.com/
my.wsdl', $options = NULL) {
if (!is_array($options))
$options = array('soap_version' => SOAP_1_1, 'trace' =>
true, 'exceptions' => true);
parent::__construct($wsdl, $options);
}
public function __soapCall($function_name, $arguments = array(),
$options = array(), $input_headers = NULL, &$output_headers = array()) {
echo "doing __soapCall\n";
return parent::__soapCall($function_name, $arguments,
$options, $input_headers, $output_headers);
}
}

The constructor works fine. As you can see __soapCall does nothing
but pass through the call to the parent, but it's just not being
called. I've found various references to overriding the __call
function (which is now completely obsolete as it clashes with a magic
method) for the same kind of reason that I need to. So, it seems as
if __soapCall is NOT called internally when calling a WSDL function,
so if my client has a login function:

$sc = new myClient();
$sc->login(array('username' => 'abc', 'password' => 'xyz'));

but this does not seem to go via the internal __soapCall function,
thus denying me the ability to tweak the request on its way through.
If I call it manually (i.e. non-WSDL way), something like:

$sc->__soapCall('login', array('username' => 'abc', 'password' =>
'xyz'));

then it works, but in that simple gesture I've lost most of the WSDL
advantage.

What am I supposed to do?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация