| | 244 | """A Controller (page handler collection) for XML-RPC. |
|---|
| | 245 | |
|---|
| | 246 | To use it, have your controllers subclass this base class (it will |
|---|
| | 247 | turn on the tool for you). |
|---|
| | 248 | |
|---|
| | 249 | You can also supply the following optional config entries: |
|---|
| | 250 | |
|---|
| | 251 | tools.xmlrpc.encoding: 'utf-8' |
|---|
| | 252 | tools.xmlrpc.allow_none: 0 |
|---|
| | 253 | |
|---|
| | 254 | XML-RPC is a rather discontinuous layer over HTTP; dispatching to the |
|---|
| | 255 | appropriate handler must first be performed according to the URL, and |
|---|
| | 256 | then a second dispatch step must take place according to the RPC method |
|---|
| | 257 | specified in the request body. It also allows a superfluous "/RPC2" |
|---|
| | 258 | prefix in the URL, supplies its own handler args in the body, and |
|---|
| | 259 | requires a 200 OK "Fault" response instead of 404 when the desired |
|---|
| | 260 | method is not found. |
|---|
| | 261 | |
|---|
| | 262 | Therefore, XML-RPC cannot be implemented for CherryPy via a Tool alone. |
|---|
| | 263 | This Controller acts as the dispatch target for the first half (based |
|---|
| | 264 | on the URL); it then reads the RPC method from the request body and |
|---|
| | 265 | does its own second dispatch step based on that method. It also reads |
|---|
| | 266 | body params, and returns a Fault on error. |
|---|
| | 267 | |
|---|
| | 268 | The XMLRPCDispatcher strips any /RPC2 prefix; if you aren't using /RPC2 |
|---|
| | 269 | in your URL's, you can safely skip turning on the XMLRPCDispatcher. |
|---|
| | 270 | Otherwise, you need to use declare it in config: |
|---|
| | 271 | |
|---|
| | 272 | request.dispatch: cherrypy.dispatch.XMLRPCDispatcher() |
|---|
| | 273 | """ |
|---|