This code works fine:
$result = $client->__call("optionalInfo", array(
new SoapParam("...", "client"),
new SoapParam("...", "add_code"))
);
When I try abstracting it a bit to make the script re-usable, I get this error:
Catchable fatal error: Object of class SoapClient could not be converted to string
The broken code is:
$params = array( new SoapParam($client, "client"),
new SoapParam($add_code, "add_code")
);
$result = $client->__call($functionName, $params);
The last line is what is causing the problem.