Skip to content

enable the web service

sarni edited this page Feb 24, 2014 · 6 revisions

Enabling the web service interface

In some occurrences the GSN the web service interface might be disabled by default. You can easily check this by

  • installing and starting GSN by [wiki:install-gsn source] or [wiki:installer binary]
  • visit http://localhost:22001 to check whether GSN is running (given that the GSN port was not changed)
  • visit http://localhost:22001/services/GSNWebService?wsdl where the WSDL should be published
  • if an XML (the web service definition) is displayed, all is fine and the web service is running
  • if you get a 404 error instead, the web service needs to be enabled

in order to enable the web service interface you have to edit the config file for it

  • if still running, stop gsn
  • open the config file at webapp/WEB-INF/web.xml
  • there are 2 areas to uncomment (you can uncomment by removing the comment tags which are <!-- and --> )
  • one is almost at the beginning of the file, starting and ending with the tag <servlet>
  • one is rather at the end of the file, starting and ending with the tag <servlet-mapping>
  • after closing and saving the file try to start GSN again and visiting above mentioned

Using the web service

The web service interface uses SOAP 1.2 for invoking methods. You have to send a soap envelope with the parameters to the respective service address such as http://localhost:22001/services/listVirtualSensorNames. There are various existing libraries for easily creating your own web service clients.

For a detailed description of the possible web service calls use the standard GSN Web Service reference for the standard GSN Web Service]

changing the standard web service

This paragraph is a short developer documentation. Usual GSN users can safely ignore it.

In order to change the standard web service

  • change the WSDL at webservices/standard/META-INF/GSNWebService.wsdl to your needs
  • from the build.xml in the root directory run the ant task dev-ws-wsdl2java
  • from the build.xml in the root directory run the ant task dev-ws-package
  • the new ws package should have been generated at webservices/standard/GSNWebService.aar
  • copy the file GSNWebService.aar to webapp/WEB-INF/services/GSNWebService.aar
  • run GSN; the new WSDL should be published at http://localhost:22001/services/GSNWebService?wsdl
  • optional: you may run the ant task "clean" from standard/build.xml to clean the source tree from non-necessary files
Clone this wiki locally