1

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.

1 Answer 1

2

Are you sure you want to send the SoapClient interface as an argument to a function call on the same object?

new SoapParam($client, "client")
Sign up to request clarification or add additional context in comments.

1 Comment

That would be my problem, and no I did not mean to do that. "Client" happens to be a field for this particular web service and I completely overlooked that. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.