(菲律宾比索)无法将类 SoapClient 的对象转换为字符串

(PHP) Object of class SoapClient could not be converted to string

提问人:Brian Griffin 提问时间:12/20/2008 最后编辑:bignoseBrian Griffin 更新时间:6/13/2009 访问量:3613

问:

此代码工作正常:


$result = $client->__call("optionalInfo", array(
    new SoapParam("...", "client"),
    new SoapParam("...", "add_code"))
);

当我尝试将其抽象化以使脚本可重用时,出现以下错误:

可捕获的致命错误:无法将 SoapClient 类的对象转换为字符串

损坏的代码是:



$params = array( new SoapParam($client, "client"),
             new SoapParam($add_code, "add_code")
);
$result = $client->__call($functionName, $params);

最后一行是导致问题的原因。

php 数组类型 soap-client

评论


答:

2赞 troelskn 12/20/2008 #1

是否确实要将 SoapClient 接口作为参数发送到同一对象上的函数调用?

new SoapParam($client, "client")

评论

0赞 Brian Griffin 12/20/2008
那将是我的问题,不,我不是故意的。“客户端”恰好是这个特定 Web 服务的一个字段,我完全忽略了这一点。谢谢!