MantisBT - WebSolarLog
View Issue Details
0000268WebSolarLogBackendpublic2014-08-12 10:212014-09-08 15:45
kkaiser 
mfrijmann 
normalfeaturealways
resolvedfixed 
 
Release 1.1.1 
0000268: Enhance API.PHP return to XML file instead
For any other external reading of the data a more convient reply from the api.php return file would be to receive an XML file instead of the current structure.

Like the attached example i have generated manually out of the return of api.php/Live

Cheers
Karsten
No tags attached.
xml SampleApiReturn.xml (1,150) 2014-08-12 10:21
http://tracker.websolarlog.com/file_download.php?file_id=43&type=bug
? outputPVAPI (981) 2014-09-02 17:38
http://tracker.websolarlog.com/file_download.php?file_id=48&type=bug
Issue History
2014-08-12 10:21kkaiserNew Issue
2014-08-12 10:21kkaiserFile Added: SampleApiReturn.xml
2014-08-12 11:37mfrijmannNote Added: 0000471
2014-08-12 11:37mfrijmannAssigned To => mfrijmann
2014-08-12 11:37mfrijmannStatusnew => confirmed
2014-08-12 11:37mfrijmannAssigned Tomfrijmann =>
2014-08-21 08:49mfrijmannChangeset attached => SourceForge trunk r1854
2014-08-21 08:58mfrijmannNote Added: 0000476
2014-08-28 09:32mfrijmannAssigned To => mfrijmann
2014-08-28 09:32mfrijmannStatusconfirmed => feedback
2014-08-28 09:32mfrijmannNote Added: 0000495
2014-09-01 11:12kkaiserNote Added: 0000496
2014-09-01 11:12kkaiserStatusfeedback => assigned
2014-09-01 12:04mfrijmannNote Added: 0000497
2014-09-02 17:38kkaiserFile Added: outputPVAPI
2014-09-02 17:40kkaiserNote Added: 0000500
2014-09-05 13:02mfrijmannNote Added: 0000501
2014-09-08 09:56mfrijmannStatusassigned => resolved
2014-09-08 09:56mfrijmannFixed in Version => Release 1.1.1
2014-09-08 09:56mfrijmannResolutionopen => fixed
2014-09-08 15:45mfrijmannNote Added: 0000505

Notes
(0000471)
mfrijmann   
2014-08-12 11:37   
Xml format should be possible.
We use JSON for WSL and is in most cases faster and consumes less data.
(0000476)
mfrijmann   
2014-08-21 08:58   
Is this solution working for you?
(0000495)
mfrijmann   
2014-08-28 09:32   
please give us an update!
(0000496)
kkaiser   
2014-09-01 11:12   
Sorry didnt receive a notification.

I checked and validated the XML file - and it seems there is one issue on the file itself with an invalid element name.

http://www.w3schools.com/xml/xml_validator.asp [^] reports that <0> is not possible as element name. Numbes are not possible to be used as Element name. As well the metering part
</metering>
seems to need an open/ end tag like:
<metering></metering>
even though emtpty.

to check you should be able to open the file in any browser and the structure should be shown.

I will review the call from openhab later this week with a correct file that looks like my attached version.

Cheers
Karsten
(0000497)
mfrijmann   
2014-09-01 12:04   
I checked it before committing the code and found no problems.

Here is mine Live call in XML and the XML_validator confirms that there are no issues with it.
http://www.frijmann.nl/websolarlog/json2xml.php?url=www.frijmann.nl/websolarlog/api.php/Live [^]

Please send me an email with the URL to your WSL or atleast the output of your XML.
(0000500)
kkaiser   
2014-09-02 17:40   
i have uploaded my output. the json2xml.php i dont have at the moment in my stable 1.1 version.

Cheers
Karsten
(0000501)
mfrijmann   
2014-09-05 13:02   
You could download json2xml.php and utils/array2xml.php place them in there directories and you could use it.
(0000505)
mfrijmann   
2014-09-08 15:45   
The source can be found on SourceForge;
http://sourceforge.net/p/websolarlog/code/HEAD/tree/ [^]

The files are here;
http://sourceforge.net/p/websolarlog/code/HEAD/tree/trunk/json2xml.php [^]
http://sourceforge.net/p/websolarlog/code/HEAD/tree/trunk/utils/array2xml.php [^]

Let me known if it works!