Qore SoapHandler Module Reference  0.2.5
SoapHandler.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SoapHandler.qm Copyright (C) 2012 - 2016 David Nichols
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // make sure we have the required qore version
26 
27 // requires XML functionality
28 
29 // requires the WSDL module
30 
31 // need mime definitions
32 
33 // need definitions from the HttpServerUtil
34 
35 // need Util functions
36 
37 // do not use $ for vars
38 
39 // require type declarations everywhere
40 
41 // do not ignore errors in call arguments
42 
43 
81 namespace SoapHandler {
84 class SoapHandler : public AbstractHttpRequestHandler {
85 
86 public:
88  const Version = "0.2.5";
89 
91  private :
92  hash methods;
93 
94  // service name -> WebService objects
95  hash wsh;
96 
97  // operation name -> WebService object
98  hash owsh;
99 
100  // lookup service name -> alternate paths
101  hash plh;
102 
103  // lookup alt path -> WebService object
104  hash wsph;
105 
106  // soapaction map: action -> operation
107  hash sam;
108 
109  // service -> soapaction
110  hash psam;
111 
112  int loglevel;
113 
114  // if True then verbose exception info will be logged
115  bool debug;
116 
117  // a closure/call reference to get the log message and/or process arguments in incoming requests
118  *code getLogMessage;
119 
120  // for atomicity when adding / removing methods
121  RWLock rwl();
122 
123  // hash of methods by path
124  hash th;
125 
126 public:
128 
130 
134  constructor(AbstractAuthenticator auth, *code n_getLogMessage, bool dbg = False);
135 
136 
138 
148  addMethod(WebService ws, WSOperation op, any func, *string help, *int logopt, any cmark, *string path, any err_func, *string altpath);
149 
150 
152  setDebug(bool dbg = True);
153 
154 
156  bool getDebug();
157 
158 
160  removeService(string name);
161 
162 
164  // don't reimplement this method; fix/enhance it in the module
165  final private addMethodInternal(WebService ws, hash method);
166 
167 
168  private *hash help(hash cx);
169 
170 
171  // don't reimplement this method; fix/enhance it in the module
172  final private log(hash cx, string str);
173 
174 
175  // don't reimplement this method; fix/enhance it in the module
176 
177 private:
178  static string makeSoapFaultResponse(bool soap12, string err, string desc, *bool fmt);
179 public:
180 
181 
182  // don't reimplement this method; fix/enhance it in the module
183  final private *hash callOperation(hash cx, any args, *string soapaction, bool reqsoap12);
184 
185 
186  // method called by HttpServer
187  // don't reimplement this method; fix/enhance it in the module
188  final hash handleRequest(hash cx, hash hdr, *data body);
189 
190 
191  private *WebService tryMatch(string path);
192 
194  };
195 };
main SoapHandler namespace
Definition: SoapHandler.qm.dox.h:82