LogMeIn API的“getSession”调用让我有点疯狂。根据他们的文档,您应该能够从getHierarchy调用中输入iNodeID,或者只从LogMeIn管理页面输入技术ID#,它将报告他们的开放会话信息,但无论我使用什么,我都会收到错误“ stdClass对象([getSessionResult] => getSession_InvalaidParam_NodeID)“有没有人见过这个?
这是我的代码:
<?php
require("/usr/local/lib/php/nusoap/nusoap.php");
$loginParams = array(
'sEmail' => *hidden*,
'sPassword' => *hidden*
);
$soapclient = new soapclient("https://secure.logmeinrescue.com/API/API.asmx?WSDL");
$loginResult = $soapclient->login($loginParams);
$hierparams = array(""=>"");
$hierarchyResult = $soapclient->getHierarchy($hierparams);
$hierarchy = $hierarchyResult->aHierarchy;
$nodes = $hierarchy->HIERARCHY;
$numberofnodes = count($nodes);
echo "<table border =\"0\" cellspacing = \"5\">";
for ($iNodes = 0; $iNodes < $numberofnodes; $iNodes += 1)
{
if($nodes[$iNodes]->eStatus == "Online" && $nodes[$iNodes]->eType == "Technician"){
print_r("<tr>");
print_r("<td>Name: " . $nodes[$iNodes]->sName . "<br /></td>");
####This works
print_r("<td>ID: " . $nodes[$iNodes]->iNodeID . "<br /></td>");.
###############
print_r("<td>Email: " . $nodes[$iNodes]->sEmail . "<br /></td>");
####This doesn't.
$sessioninfo = $soapclient->getSession($nodes[$iNodes]->iNodeID);
################
print_r("<td>Session Dump: ". print_r($sessioninfo) . "</td>");
print_r("</td>");
}
}
print_r("</table>");
$soapclient->logout();
?>
答案 0 :(得分:0)
原来我忽略了一个参数eNodeRef,其默认参数为“NODE”。
$iNodeID = $nodes[$iNodes]->iNodeID;
$eNodeRef = "NODE";
$sessionparams = array(
'iNodeID' => $iNodeID,
'eNodeRef' => $eNodeRef
);
$sessionresult = $soapclient->getSession($sessionparams);