Qore SoapHandler Module Reference  0.2.4
 All Classes Namespaces Functions Variables Pages
SoapHandler.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* SoapHandler.qm Copyright 2012 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 
26 // make sure we have the required qore version
27 
28 // requires XML functionality
29 
30 // requires the WSDL module
31 
32 // need mime definitions
33 
34 // need definitions from the HttpServer
35 
36 
37 /* Version History
38  * 2012-05-31 v0.2.4: David Nichols <david@qore.org>: updated to a user module
39  * v0.2.3: return correct soap fault structure according to request
40  * v0.2.2: soap 1.2 improvements
41  * v0.2.1: matched to new WSDL and HttpServer implementation
42  * v0.2.0: better WSDL support
43  * v0.1.0: initial WSDL-based SOAP support (still incomplete)
44 */
45 
55 namespace SoapHandler {
58 class SoapHandler : public AbstractHttpRequestHandler {
59 
60 public:
62  const Version = "0.2.4";
63 
65  private :
66  hash methods;
67  mi;
68 
69  // hash of WebService objects (values) per path (keys)
70  hash ws;
71 
72  // hash: path -> top-level-method-name -> method
73  hash pathmethods;
74 
75  int loglevel;
76 
77  // if True then verbose exception info will be logged
78  bool debug;
79 
80  // a closure/call reference to get the log message and/or process arguments in incoming requests
81  *code getLogMessage;
82 
83  // for atomicity when adding / removing methods
84  RWLock rwl();
85 
86  // hash of methods by path
87  hash th;
88 
89 public:
91 
93 
97  constructor(AbstractAuthenticator auth, *code getLogMessage, bool dbg = False);
98 
99 
101 
109  addMethod(WebService ws, WSOperation op, any func, *string help, *int logopt, any cmark, *string path);
110 
111 
113  removeServicesWithPath(string path);
114 
115 
117  // don't reimplement this method; fix/enhance it in the module
118 
119 private:
120  final addMethodInternal(WebService ws, hash method);
121 public:
122 
123 
124 
125 private:
126  *hash help(hash cx);
127 public:
128 
129 
130  // don't reimplement this method; fix/enhance it in the module
131 
132 private:
133  final log(hash cx, string str);
134 public:
135 
136 
137  // don't reimplement this method; fix/enhance it in the module
138 
139 private:
140  static string makeSoapFaultResponse(bool soap12, string err, string desc);
141 public:
142 
143 
144  // don't reimplement this method; fix/enhance it in the module
145 
146 private:
147  final hash callOperation(hash cx, any args);
148 public:
149 
150 
151  // method called by HttpServer
152  // don't reimplement this method; fix/enhance it in the module
153  final hash handleRequest(hash cx, hash hdr, *data body);
154 
156  };
157 };
const Version
version of the SoapHandler implementation
Definition: SoapHandler.qm.dox.h:62
SoapHandler implementation; to be registered as a request handler in the HttpServer class...
Definition: SoapHandler.qm.dox.h:58
removeServicesWithPath(string path)
call to remove all service mappings for services with the given path
addMethod(WebService ws, WSOperation op, any func, *string help, *int logopt, any cmark, *string path)
adds a method to the handler dynamically
constructor(AbstractAuthenticator auth, *code getLogMessage, bool dbg=False)
creates the handler with the given method list