Can not get XML data from idigi

I have ConnectPortX4.
I uploaded XML data with dia program in idigi server.

I want to get or set XML from idigi server with my client application.
But I can not connect iDigi server with Python_Expales(http://www.idigi.com/iDigi_Python_Examples.zip)

I changed examples’s URL and username and password.

(url = ‘https://developer.idigi.com/cwmfiles/DEIVE_ID/green_demo
query = ‘/channel_samples1.xml’)
But program’s response was login page’s html source.

Username and password are correct.

What should I do?

Regurds.

Hi,

To retrieve this data from a client you should use the /ws/data web service. The URL to retrieve in this case would be: https://developer.idigi.com/ws/data/~/DEVICE_ID/green_demo/channel_samples1.xml

This web service is intended for end use by various clients. The cwmfiles interface is used internally for the web page file interface, and should not be used by other clients.

thank you for your good suggestion.
My problem was solved.

Hi,

I’m very interesting by this answer. Could you be a little bit more explicit about the URL.

DEVICE is the gateway mac address?
Must I add a “/” before xml file name ?
Where can I put the password and username?

Thank you for the response.

Grigou25

Hello,

https://developer.idigi.com/ws/data/~/DEVICE_ID/green_demo/channel_samples1.xml

DEVICE_ID is not the mac address, but is an identifier that is typically based on the mac address for device that has ethernet or wifi as its primary interface. You can find the device ID on the home page of your device’s web UI, or by looking at the Device ID column in the device list in iDigi.

There will always be a “/” after the DEVICE_ID, when pulling files pushed up by the device. After the “/” you may immediately have the file name, or you may have more “/” separating folders/collections. If you are using Dia in the device, this is configurable.

If you just want to look at the folder in your web browser, you can just type in the URL and it should prompt you for the username and password. (Or you can put it like this: https://username:password@idigi.com/…, and the browser will pull the authentication info in).

If you are trying to write an application to pull the files down, it will depend on your programming language. There is a web service console in iDigi that has a bunch of examples, and some are related to pulling files down from the /ws/data web service. You can use this to export code in a number of different languages to see how you might access the data from an application.

Chris

Hi Cpopp,

With your explication, I progress but it’s quite new for me and I don’t succeed.

So, in html, I write the adress:
https://developer.idigi.com/ws/data/~/00409DFF-FF3DB61A/sensor_demo/sensor_reading1.xml

and I receive in my browser :

"HTTP Status 404 -

type Status report

message

description The requested resource () is not available.

Apache Tomcat/6.0.20"

I don’t understand what I do wrong.

My final objective is to read data in the xml from web application wrote in asp.net.

Grigou

Hi Cpopp,

I succeed in my web browser with this URL
https://developer.idigi.com/ws/data/~/00000000-00000000-00409DFF-FF3DB61A/sensor_demo/sensor_reading2.xml

My web browser asks me the username and the password and then I can the the xml data.

Now, I’m in my asp.net application and I want to parse my xml file. I wrote the URL with password and username and it gives something like this :

https://myusername:mypassword@idigi.com/ws/data/~/00000000-00000000-00409DFF-FF3DB61A/sensor_demo/sensor_reading2.xml

but when i try to read my xwlreader, I receive the error
[WebException: Le serveur distant a retourné une erreur : (502) Passerelle incorrecte.]

Any idea? Thanks

Hi,

I could be wrong, but it looks like it won’t support the username:password in the URL. I’m not familiar with asp.net, so you might try searching around a bit on the net for how to do an HTTP GET with authentication for your asp.net application.

Thanks,
Chris