I have a SoapClient instance generated for a WSDL file. All except one of the method invocations require the username and the password to be passed id.
Is there any
Although not a very good solution, you could write a basic wrapper class that used PHPs magic methods (Specifically __call) to call the actual function but append the user name and password to the argument list.
Basic example:
class SC
{
private $user;
private $pass;
public function __construct($user, $pass)
{
$this->user = $user;
$this->pass = $pass;
}
public function __call($name, $arguments)
{
$arguments = array_merge(array($this->user, $this->pass), $arguments);
call_user_func_array($name, $arguments);
}
}
You can use partial application and curry functions from Non-standard PHP library.