customservice.py
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# coding=utf-8
"""" Simple SERVICE custom implementation
http://localhost:8080/cgi-bin/qgis_mapserv.cgi?MAP=/qgis-server/projects/helloworld.qgs&SERVICE=CUSTOM
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author__ = 'elpaso@itopen.it'
__date__ = '2019-08-26'
__copyright__ = 'Copyright 2019, ItOpen'
from dmap_server import *
class CustomServiceService(DmpService):
def __init__(self):
DmpService.__init__(self)
def name(self):
return "CUSTOM"
def version(self):
return "1.0.0"
def allow_method(self):
return True
def execute_request(self, request, response):
response.status_code = 200
response.write("Custom service executeRequest")
class CustomService():
def __init__(self, serverIface):
self.serv = CustomServiceService()
serverIface.service_registry().register_service(CustomServiceService())