Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e486e0d0
Commit
e486e0d0
authored
Sep 28, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preliminary documentation for the SimpleXMLRPCServer module.
parent
abf925f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
Doc/lib/libsimplexmlrpc.tex
Doc/lib/libsimplexmlrpc.tex
+69
-0
No files found.
Doc/lib/libsimplexmlrpc.tex
0 → 100644
View file @
e486e0d0
\section
{
\module
{
SimpleXMLRPCServer
}
---
Basic XML-RPC server
}
\declaremodule
{
standard
}{
SimpleXMLRPCServer
}
\moduleauthor
{
Brian Quinlan
}{
brianq@activestate.com
}
\sectionauthor
{
Fred L. Drake, Jr.
}{
fdrake@acm.org
}
The
\module
{
SimpleXMLRPCServer
}
module provides a basic server
framework for XML-RPC servers written in Python. The server object is
based on the
\code
{
\refmodule
{
SocketServer
}
.TCPServer
}
class,
and the request handler is based on the
\code
{
\refmodule
{
BaseHTTPServer
}
.BaseHTTPRequestHandler
}
class.
\begin{classdesc}
{
SimpleXMLRPCServer
}{
addr
\optional
{
,
requestHandler
\optional
{
, logRequests
}}}
Create a new server instance. The
\var
{
requestHandler
}
parameter
should be a factory for request handler instances; it defaults to
\class
{
SimpleXMLRPCRequestHandler
}
. The
\var
{
addr
}
and
\var
{
requestHandler
}
parameters are passed to the
\class
{
\refmodule
{
SocketServer
}
.TCPServer
}
constructor. If
\var
{
logRequests
}
is true (the default), requests will be logged;
setting this parameter to false will turn off logging. This class
provides methods for registration of functions that can be called by
the XML-RPC protocol.
\end{classdesc}
\begin{classdesc}
{
SimpleXMLRPCRequestHandler
}{}
Create a new request handler instance. This request handler
supports
\code
{
POST
}
requests and modifies logging so that the
\var
{
logRequests
}
parameter to the
\class
{
SimpleXMLRPCServer
}
constructor parameter is honored.
\end{classdesc}
\subsection
{
SimpleXMLRPCServer Objects
\label
{
simple-xmlrpc-servers
}}
The
\class
{
SimpleXMLRPCServer
}
class provides two methods that an
application can use to register functions that can be called via the
XML-RPC protocol via the request handler.
\begin{methoddesc}
[SimpleXMLRPCServer]
{
register
_
function
}{
function
\optional
{
,
name
}}
Register a function that can respond to XML-RPC requests. The
function must be callable with a single parameter which will be the
return value of
\function
{
\refmodule
{
xmlrpclib
}
.loads()
}
when called
with the payload of the request. If
\var
{
name
}
is given, it will be
the method name associated with
\var
{
function
}
, otherwise
\code
{
\var
{
function
}
.
__
name
__}
will be used.
\var
{
name
}
can be
either a normal or Unicode string, and may contain characters not
legal in Python identifiers, including the period character.
\end{methoddesc}
\begin{methoddesc}
[SimpleXMLRPCServer]
{
register
_
instance
}{
instance
}
Register an object which is used to expose method names which have
not been registered using
\method
{
register
_
function()
}
. If
\var
{
instance
}
contains a
\method
{_
dispatch()
}
method, it is called
with the requested method name and the parameters from the request;
the return value is returned to the client as the result. If
\var
{
instance
}
does not have a
\method
{_
dispatch()
}
method, it is
searched for an attribute matching the name of the requested method;
if the requested method name contains periods, each component of the
method name is searched for individually, with the effect that a
simple hierarchical search is performed. The value found from this
search is then called with the parameters from the request, and the
return value is passed back to the client.
\end{methoddesc}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment