WXforum.net

Weather Software => WeatherLink/weatherlink.com by Davis Instruments => Topic started by: sheldon on April 12, 2017, 11:02:03 AM

Title: xml problem in Weatherlink.com
Post by: sheldon on April 12, 2017, 11:02:03 AM
Hi guys,
My Davis weather station sends data to weatherlink.com by Weatherlink IP. I put them on my personal website through a php code which includes the following xml file, generated by Weatherlink.com:
http://www.weatherlink.com/xml.php?user=xxxx&pass=xxxx
But now it seems that this file is not working anymore:
if I try to open that file, I get this message:
 [ You are not allowed to view attachments ]
And my site is consequently reporting error messages
 [ You are not allowed to view attachments ]

Is anyone having the same issue? Can it be a temporary problem of Weatherlink.com?
Thank you,
Andrea
Title: Re: xml problem in Weatherlink.com
Post by: Jáchym on April 12, 2017, 11:11:26 AM
They must have changed it because now all scripts (including the one I use in my template) and even some apps are broken.

I recommend you email them about it because this is affecting anyone using those XML feeds
Title: Re: xml problem in Weatherlink.com
Post by: johnd on April 12, 2017, 11:35:05 AM
Davis are aware of the issue. As I've commented elsewhere, I suspect that there are some ongoing updates and maintenance that have triggered the issue. If I hear anything more definitive, I'll add a comment here.
Title: Re: xml problem in Weatherlink.com
Post by: saratogaWX on April 12, 2017, 11:36:50 AM
They seem to have a blank line before the <?xml ... line.  that causes the issue, I think.

A quick workaround might be to do a trim() on the raw XML before parsing.
So instead of using simplexml_load_file("http://weatherlink.com/...")  maybe using:
simplexml_load_string(trim(file_get_contents("http://weatherlink.com/...")))
will get around the problem ?
Title: Re: xml problem in Weatherlink.com
Post by: Jáchym on April 12, 2017, 11:44:07 AM
Probably, but Im hoping they will fix this, many users dont watch this and if I release an update they wont notice for several days and this obviously means there is no data going to the db. The other issue is that I obviously cannot test this myself having no Davis station..

But what you suggested Ken is exactly what I would do, not load the file, but load it as string and trim it
Title: Re: xml problem in Weatherlink.com
Post by: Jáchym on April 12, 2017, 01:06:41 PM
Obviously they must have been doing some changes to the scripts that generate this and it is disappointing to see they didnt do a single test before releasing it, otherwise they would immediately notice these feeds are not properly formatted and will cause major issues to all apps/pages that use them (and as far as I understand it, thats what they are for - to be used by others). Sort of "WU-approach"...
Title: Re: xml problem in Weatherlink.com
Post by: sheldon on April 12, 2017, 01:21:17 PM
They seem to have a blank line before the <?xml ... line.  that causes the issue, I think.

A quick workaround might be to do a trim() on the raw XML before parsing.
So instead of using simplexml_load_file("http://weatherlink.com/...")  maybe using:
simplexml_load_string(trim(file_get_contents("http://weatherlink.com/...")))
will get around the problem ?

This solved the issue! Thank you!
Meanwhile I wrote an e-mail to support@davisnet.com, but I didn't get any answer yet.
Title: Re: xml problem in Weatherlink.com
Post by: wvdkuil on April 12, 2017, 01:25:01 PM
They seem to have a blank line before the <?xml ... line.  that causes the issue, I think.

A quick workaround might be to do a trim() on the raw XML before parsing.
So instead of using simplexml_load_file("http://weatherlink.com/...")  maybe using:
simplexml_load_string(trim(file_get_contents("http://weatherlink.com/...")))
will get around the problem ?

This solved the issue! Thank you!
Meanwhile I wrote an e-mail to support@davisnet.com, but I didn't get any answer yet.
Other topics about this same issue:
http://www.wxforum.net/index.php?topic=31913.msg320703#msg320703
http://www.wxforum.net/index.php?topic=31914.msg320719#msg320719
Wim
Title: Re: xml problem in Weatherlink.com
Post by: johnd on April 12, 2017, 03:48:21 PM
Should be fixed now at wl.com.