I’m hoping that someone can give me some pointers about the best way to proceed.
I have a HTTP service accessed through the following url http://localhost:8082/edenserver?op=status that gives me the following xml back:
<?xml version="1.0" encoding="UTF-8"?>
-<eden:serverStatus version="Version 7.8.3" t="26/11/2014 17:05:40.990" process="EdenServer" identity="0504640A.14124.01D0098B.7A248099" host="Incidents" xmlns:eden="http://ift.tt/1FsntvN">
<edenServer state="Running" pid="14124" consoleVisible="false"/>
-<sessions>
<session type="XmlClient" status="Idle" rootModel="Incident Entry#1.45" name="xxxx" id="43150" expires="1668"/>
<session type="XmlClient" status="Idle" rootModel="Incident Entry#1.45" name="xxxx" id="43156" expires="1799"/>
<session type="XmlClient" status="Idle" name="xxxx" id="43158" expires="1799"/>
</sessions>
-<models>
<model name="PI Method to Floor Selection#1.45" id="4466" instances="2"/><model name="Involved Parties ID Buttons#1.45" id="4471" instances="10"/>
<model name="PI De-Escalation Selection#1.45" id="4472" instances="2"/><model name="PI Technique Selection#1.45" id="4473" instances="2"/>
</models>
-<dataSources>
<dataSource type="SQL Server Native Client 10.0" name="EDENMODELSINCIDENTS" noOfConnections="3"/>
</dataSources>
</eden:serverStatus>
What I’d like to be able to do is to read the xml response from this url and then count the number of session nodes that have a rootModel property and then print this number.
Can anyone give me some pointers on how to handle this. Apologies if any of my terminology is wrong.
No comments:
Post a Comment