Commit 2f96d7d9 authored by Javier Quinteros's avatar Javier Quinteros

Add default method for DataselectAPI taking care of application.wadl

parent 83605bdd
......@@ -587,10 +587,19 @@ class DataselectAPI(object):
return texthelp.encode('utf-8')
@cherrypy.expose
def applicationwadl(self, wsversion='1'):
if wsversion != '1':
def default(self, *args, **kwargs):
"""Use default method to process application.wadl because the dot is not supported in method names"""
cherrypy.log('default method: %s %s' % (args, kwargs))
if args[0] != '1':
# Send Error 400
message = 'Only Station-WS version 1 is supported'
message = 'Only Dataselect-WS version 1 is supported'
# self.__log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message))
if args[1] != 'application.wadl':
# Send Error 400
message = 'Unknown method "%s"' % args[1]
# self.__log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message))
......@@ -607,7 +616,7 @@ class DataselectAPI(object):
# Send Error 400
message = 'application.wadl not found!'
# self.log.error(message)
# self.__log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message))
......@@ -668,7 +677,7 @@ class DataselectAPI(object):
# Check parameters
if wsversion != '1':
# Send Error 400
message = 'Only Station-WS version 1 is supported'
message = 'Only Dataselect-WS version 1 is supported'
# self.__log.error(message)
cherrypy.response.headers['Content-Type'] = 'text/plain'
raise cherrypy.HTTPError(400, errormessage(400, message))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment