我使用 PHP 5.3.1 调用网络服务,我的请求如下所示:
<?php
$client = new SoapClient('the API wsdl');
$param = array(
'LicenseKey' => 'a guid'
);
$result = $client->GetUnreadIncomingMessages($param);
echo "<pre>";
print_r($result);
echo "</pre>";
?>
这是我得到的回复:
stdClass Object
(
[GetUnreadIncomingMessagesResult] => stdClass Object
(
[SMSIncomingMessage] => Array
(
[0] => stdClass Object
(
[FromPhoneNumber] => the number
[IncomingMessageID] => message ID
[MatchedMessageID] =>
[Message] => Hello there
[ResponseReceiveDate] => 2012-09-20T20:42:14.38
[ToPhoneNumber] => another number
)
[1] => stdClass Object
(
[FromPhoneNumber] => the number
[IncomingMessageID] =>
[MatchedMessageID] =>
[Message] => hello again
[ResponseReceiveDate] => 2012-09-20T20:42:20.69
[ToPhoneNumber] => another number
)
)
)
)