1 (edited by leonardo.rigutini 16-10-2012 21:51:57)

Topic: App for smartphone and access to the data services of Indicia - SOLVED

Hi all,
I'm developing an educational application for smartphone which require to get data from an indicia warehouse.
I've seen the DataServices tutorial pages and I think they are ok for main goal. However to use them it is required to use the DigestAuthentication which is based on a nonce and a auth_token.
I'm trying to call the get_read_nonce service to have the nonce (passing the website_id POST parameter) but the response is "Unable to Complete Request"... I have one only site which id is 1.
Maybe I'm missing something but the documentation about this aspect is very poor and I don't know how to proceed.

Where am I doing wrong?
What I'm missing?

Thanks in advance
Leonardo

2

Re: App for smartphone and access to the data services of Indicia - SOLVED

Hi Leonardo
I presume you have seen the documentation at http://code.google.com/p/indicia/wiki/D … entication?

It sounds like you are doing the right thing though - basically you must use an HTML form (or the equivalent code) to POST website_id=1 to the web service at .../index.php/services/security/get_read_nonce. If you copy the example page from the documentation then modify it to point to your own warehouse, you should find it works OK. If not then it points to a problem on the warehouse. If it does work OK then you'll need to look at your code to see if you spot any differences. The error message you are getting is consistent with not sending the website_id in the POST data, e.g. if there was a spelling mistake or you had put it in GET data instead?

John van Breda
Biodiverse IT

3

Re: App for smartphone and access to the data services of Indicia - SOLVED

hi john,
thanks for your answer.

I use a Java class which calls the REST end-point and passes website_di as POST parameter... It simulates the html form reported in the help page and it should be the same. My dubt was that Indicia could require some configure operation to enable DataService functionality which I don't know since not explicitally described in the user guide documentation. I work on an Ubuntu 10.04 machine with Apache2 and Php5 working. I installed PostgrSQL, PostGIS and the relative modules for Php. I dowloaded the Indicia Wharehouse code and put it into web directory and set the permission of the subdirectories: the frontend and the backend are fully functional. I did not create a new site but I used the one provided with the installation (after renamed it into MySite). Its id (read from site description) is 1 and I use that to call the get_read_nonce dataService end point.
Some idea?

Thanks in advance for your help.

Leonardo

4 (edited by leonardo.rigutini 16-10-2012 21:50:28)

Re: App for smartphone and access to the data services of Indicia - SOLVED

Solved...
The problem was the apache postgresql module....i think...
I reinstalled it and now the data services work....

Leonardo

5

Re: App for smartphone and access to the data services of Indicia - SOLVED

Hi Leonardo

I'm glad you have fixed your problem. For your information, some developers at Bristol University have developed a mobile application. See http://planttracker.naturelocator.org/

Their approach has been to establish communication between the app and a Drupal based website. The website then submits records to the warehouse. This has allowed them to make use of the functions in the client_helpers library for communication with the warehouse. It is also expected, when they add user registration, that Drupal functions will help this.

You can read a couple of interesting blog posts about the developement
http://planttracker.naturelocator.org/b … nd-jqtouch
http://planttracker.naturelocator.org/b … nt-so-hard

If at all possible, I would be really happy to see you collaborating with them on solutions that can be shared by others in the Indicia community.

Regards,
Jim Bacon

6

Re: App for smartphone and access to the data services of Indicia - SOLVED

Hi Jim, Leonardo is working with us in the framework of a joint project between our museum and the Maremma Regional Park. We will be of course very happy to share in the Indicia community.

Regards,

Andrea