[52N SWE] Add operations to the SOS

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[52N SWE] Add operations to the SOS

french30@inwind.it
Hi,
I have the SOS on my pc and it works well,
I have a sensor that already exists and I can not change, the sensor sends
data to a web service by invoking a method which they called "upload" and send
a string of data which are measurements of the sensor.
I made my own web services with a method of "upload" which receives data from
the sensor, the handler properly and places the data in the table of
SosDatabase observation.
Now I would like to add this method to the SOS in order to directly use the
SOS to receive data and store them in SosDatabase.
But I do not know how to add a method, for example "upload", in SOS.
Can you help?


Thanks
Francesco
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org
Reply | Threaded
Open this post in threaded view
|

Re: [52N SWE] Add operations to the SOS

Carsten Hollmann-3
Hi Francesco,

I think the best way is to send the data via HTTP-GET to the SOS.
E.g. the parameters are REQUEST=UPLOAD, SERVICE=SOS, VERSION=1.0.0 and
your parameter for the data named 'DATA' or 'VALUE'.

Here is the easiest way to integrate the function into the SOS code:
1. HttpGetRequestDecoder(Standard or Mobile, look in the sos.config file
which is used)
- add an elseIf block in the receiveRequest() method that calls the
following method to parse the UPLOAD request.
- add a new method(e.g. parseUploadRequest()) that parses the UPLOAD
request and returns a SosInsertObservationRequest, build from the
request data.
2. ReuqestOperator
- add an elseIf block in the doGetOperation method that looks like
else if (request instanceof SosInsertObservationRequest) {
             requestListener = (InsertObservationListener)
reqListener.get(Operations.insertObservation.toString());
         }
Then the data is inserted into the database with the exiting code.

Regards,
Carsten
-----

Carsten Hollmann

IfGI - Institute for Geoinformatics
University of Muenster

Mail: [hidden email]

Am 27.09.2010 22:48, schrieb [hidden email]:

> Hi,
> I have the SOS on my pc and it works well,
> I have a sensor that already exists and I can not change, the sensor sends
> data to a web service by invoking a method which they called "upload" and send
> a string of data which are measurements of the sensor.
> I made my own web services with a method of "upload" which receives data from
> the sensor, the handler properly and places the data in the table of
> SosDatabase observation.
> Now I would like to add this method to the SOS in order to directly use the
> SOS to receive data and store them in SosDatabase.
> But I do not know how to add a method, for example "upload", in SOS.
> Can you help?
>
>
> Thanks
> Francesco
> _______________________________________________
> SWE mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/swe
> http://sensorweb.forum.52north.org
>
_______________________________________________
SWE mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/swe
http://sensorweb.forum.52north.org