Jump to content

Parsing / Filtering XML


gramphp

Recommended Posts

Hi all,

 

    I am working on a tool to pull data remotely and the data is set to xml format. I want to post items that meet a certain criteria only, essentially there are several layers/tags on the data being brought over. The sStatus is the primary item I am looking for, not only that but only if it has or equals to "Waiting". Any thoughts or suggestions greatly appreciated. Below is the basic code I have in place currently and am working on.

 

<code>

<?php

$soapclient = new SoapClient("https://secure.logmeinrescue.com/api/api.asmx?wsdl");

 

 

$sEmail = "dummy@dum.com";

$sPassword = "dum123";

$iNodeID = "123456";   

$eNodeRef = "NODE";   

$sAuthCode = "";

 

$loginparams = array (

'sEmail' => $sEmail,

'sPassword' => $sPassword);

 

$loginResult = $soapclient->login($loginparams);

 

$output = array(

'eOutput' => "XML"

);

 

$outputResponse = $soapclient->setOutput($output);

 

 

$sessionparams = array(

'iNodeID' => $iNodeID,

'eNodeRef' => $eNodeRef,

'sAuthCode' => $sAuthCode

);

 

//get session(s)

$sessionresult = $soapclient->getSession($sessionparams);

$session = $sessionresult->aSessions;

$sessionnodes = $session->SESSION;

$session_status = $sessionnodes[$isessionNodes]->sStatus;

   

 

 

print_r($sessionresult);

 

?>

</code>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.