Commit 83605bdd authored by Javier Quinteros's avatar Javier Quinteros

Add default method for StationAPI taking care of application.wadl

parent bf60959c
......@@ -197,7 +197,6 @@ class TdmswsAPI(object):
return texthelp.encode('utf-8')
@cherrypy.expose
@cherrypy.popargs('wsversion')
class StationAPI(object):
......@@ -222,14 +221,6 @@ class StationAPI(object):
if self.__loc == '':
self.__loc = '--'
# def _cp_dispatch(self, vpath):
# cherrypy.log('%s' % vpath)
# if vpath[0] == 'application.wadl':
# vpath.pop(0)
# cherrypy.log('%s' % vpath)
# return self.applicationwadl
#
# return self
@cherrypy.expose
def index(self, wsversion='1'):
......@@ -256,14 +247,23 @@ class StationAPI(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'
# 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))
project_dir = os.path.dirname(__file__)
try:
......
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