Overriding __soapCall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux