我正在与API通信,我得到以下XML结果(在API的日志中检查):
<sfobject>
<id>USR-3192</id>
<type>User</type>
<lastName>Lochki</lastName>
<city>Gdynia</city>
</sfobject>
但出于某种原因,当我在PHP中使用__SoapCall然后想要显示结果时,lastName和City会合并并在'any'下显示为一个? :
stdClass::__set_state(array(
'id' => 'USR-3192',
'type' => 'User',
'any' => 'LochkiGdynia',
)),
可能有什么想法?这对我来说没什么意义。
这是代码。我之前成功登录。
$request1 = array(
'query' => array(
'queryString' => "SELECT lastName,city FROM User WHERE firstName = 'Marek'",
),
);
$response1 = $objSoapClient->__soapCall('query', $request1);
echo "<pre>";
var_export($response1);
echo "</pre>";
我已经发现文档中提到了“any”,如下所示:
any
List<Object>
The list of the SFObject fields. The format is <FieldName>FieldValue</FieldName>.
The list element is a DOM object.
我怎样才能正确访问它?
当我查看源代码时,它显示如下:
[0] => stdClass Object
(
[id] => USR-3192
[type] => User
[any] => <lastName>Lochki</lastName><city>Gdynia</city>
)
我怎样才能完成它?