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