Several markup adjustments so this will format and be more consistent with

the rest of the documnentation.
This commit is contained in:
Fred Drake 2001-07-12 23:39:24 +00:00
parent ae67647ab7
commit 5ddf7adf84
1 changed files with 45 additions and 35 deletions

View File

@ -17,17 +17,8 @@ structured data. This module supports writing XML-RPC client code; it
handles all the details of translating between conformable Python handles all the details of translating between conformable Python
objects and XML on the wire. objects and XML on the wire.
\begin{seealso} \begin{classdesc}{Server}{\optional{uri\optional{, transport\optional{,
\seetitle{http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html} encoding\optional{, verbose}}}}}
{XML-RPC HOWTO}{A good description of XML operation and client
software in several languages. Contains pretty much
everything an XML-RPC client developer needs to know.}
\seetitle{http://xmlrpc-c.sourceforge.net/hacks.php}
{XML-RPC-Hacks page}{Extensions for various open-source
libraries to support instrospection and multicall.}
\end{seealso}
\begin{classdesc}{Server}{\optional{uri\optional{, transport, encoding, verbose}}}
A \class{Server} instance is a server proxy that manages communication A \class{Server} instance is a server proxy that manages communication
with a remote XML-RPC server. The required first argument is a URI with a remote XML-RPC server. The required first argument is a URI
(Uniform Resource Indicator), and will normally be the URL of the (Uniform Resource Indicator), and will normally be the URL of the
@ -50,26 +41,38 @@ following (and except where noted, they are unmarshalled as the same
Python type): Python type):
\begin{tableii}{l|l}{constant}{Name}{Meaning} \begin{tableii}{l|l}{constant}{Name}{Meaning}
\lineii{boolean}{The True and False constants that then module supplies} \lineii{boolean}{The \constant{True} and \constant{False} constants}
\lineii{integers}{Pass in directly} \lineii{integers}{Pass in directly}
\lineii{floating-point numbers}{Pass in directly} \lineii{floating-point numbers}{Pass in directly}
\lineii{strings}{Pass in directly} \lineii{strings}{Pass in directly}
\lineii{arrays}{Any Python sequence type containing conformable \lineii{arrays}{Any Python sequence type containing conformable
elements. Arrays are returned as lists} elements. Arrays are returned as lists}
\lineii{structures}{A Python dictionary. Keys must be strings, \lineii{structures}{A Python dictionary. Keys must be strings,
values may be any conformable type.} values may be any conformable type.}
\lineii{dates}{in seconds since the epoch; pass in an instance of the \lineii{dates}{in seconds since the epoch; pass in an instance of the
\class{DateTime} wrapper class} \class{DateTime} wrapper class}
\lineii{binary data}{pass in an instance of the \class{Binary} wrapper class} \lineii{binary data}{pass in an instance of the \class{Binary}
wrapper class}
\end{tableii} \end{tableii}
This is the full set of data types supported by XML-RPC. Method calls This is the full set of data types supported by XML-RPC. Method calls
may also return a special \class{Fault} instance, used to signal XML-RPCserver may also raise a special \exception{Fault} instance, used to signal
errors, or a \class{ProtocolError} instance used to signal an error in XML-RPC server errors, or \exception{ProtocolError} used to signal an
the HTTP/HTTPS transport layer. error in the HTTP/HTTPS transport layer.
\end{classdesc} \end{classdesc}
\begin{seealso}
\seetitle[http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html]
{XML-RPC HOWTO}{A good description of XML operation and
client software in several languages. Contains pretty much
everything an XML-RPC client developer needs to know.}
\seetitle[http://xmlrpc-c.sourceforge.net/hacks.php]
{XML-RPC-Hacks page}{Extensions for various open-source
libraries to support instrospection and multicall.}
\end{seealso}
\subsection{Server Objects \label{server-objects}} \subsection{Server Objects \label{server-objects}}
A \class{Server} instance proxy object has a method corresponding to A \class{Server} instance proxy object has a method corresponding to
@ -120,12 +123,14 @@ PHP, C and Microsoft .NET. Partial introspection support is included
in recent updates to UserLand Frontier. Introspection support for in recent updates to UserLand Frontier. Introspection support for
Perl, Python and Java is available at the XML-RPC Hacks page. Perl, Python and Java is available at the XML-RPC Hacks page.
\subsection{Boolean Objects \label{boolean-objects}} \subsection{Boolean Objects \label{boolean-objects}}
This class may be initialized from any Python value; the instance This class may be initialized from any Python value; the instance
returned depends onlyon its truth value. It supports various Python returned depends only on its truth value. It supports various Python
operators through \class{__cmp__}, \class{__repr__}, \class{__int__}, operators through \method{__cmp__()}, \method{__repr__()},
and \class{__nonzero__} methods, all implemented in the obvious ways. \method{__int__()}, and \method{__nonzero__()} methods, all
implemented in the obvious ways.
It also has the following method, supported mainly for internal use by It also has the following method, supported mainly for internal use by
the unmarshalling code: the unmarshalling code:
@ -134,6 +139,7 @@ the unmarshalling code:
Write the XML-RPC encoding of this Boolean item to the out stream object. Write the XML-RPC encoding of this Boolean item to the out stream object.
\end{methoddesc} \end{methoddesc}
\subsection{DateTime Objects \label{datetime-objects}} \subsection{DateTime Objects \label{datetime-objects}}
This class may initialized from date in seconds since the epoch, a This class may initialized from date in seconds since the epoch, a
@ -152,6 +158,7 @@ Write the XML-RPC encoding of this DateTime item to the out stream object.
It also supports certain of Python's built-in operators through It also supports certain of Python's built-in operators through
\method{_cmp__} and \method{__repr__} methods. \method{_cmp__} and \method{__repr__} methods.
\subsection{Binary Objects \label{binary-objects}} \subsection{Binary Objects \label{binary-objects}}
This class may initialized from string data (which may include NULs). This class may initialized from string data (which may include NULs).
@ -163,12 +170,14 @@ Accept a base64 string and decode it as the instance's new data.
\end{methoddesc} \end{methoddesc}
\begin{methoddesc}{encode}{out} \begin{methoddesc}{encode}{out}
Write the XML-RPC base 64 encoding of this binary item to the out stream object. Write the XML-RPC base 64 encoding of this binary item to the out
stream object.
\end{methoddesc} \end{methoddesc}
It also supports certain of Python's built-in operators through a It also supports certain of Python's built-in operators through a
\method{_cmp__} method. \method{_cmp__} method.
\subsection{Fault Objects \label{fault-objects}} \subsection{Fault Objects \label{fault-objects}}
A \class{Fault} object encapsulates the content of an XML-RPC fault tag. A \class{Fault} object encapsulates the content of an XML-RPC fault tag.
@ -182,6 +191,7 @@ A string indicating the fault type.
A string containing a diagnostic message associated with the fault. A string containing a diagnostic message associated with the fault.
\end{memberdesc} \end{memberdesc}
\subsection{ProtocolError Objects \label{protocol-error-objects}} \subsection{ProtocolError Objects \label{protocol-error-objects}}
A \class{ProtocolError} object describes a protocol error in the A \class{ProtocolError} object describes a protocol error in the
@ -206,6 +216,7 @@ A string containing the headers of the HTTP/HTTPS request that
triggered the error. triggered the error.
\end{memberdesc} \end{memberdesc}
\subsection{Convenience Functions} \subsection{Convenience Functions}
\begin{funcdesc}{boolean}{value, \optional{truefals=(False, True)}} \begin{funcdesc}{boolean}{value, \optional{truefals=(False, True)}}
@ -218,20 +229,19 @@ by the first argument's Python truth value.
Trivially convert any Python string to a \class{Binary} object. Trivially convert any Python string to a \class{Binary} object.
\end{funcdesc} \end{funcdesc}
\subsection{Example of Client Usage
\subsection{Example of Client Usage \label{xmlrpc-client-example}}
\begin{verbatim} \begin{verbatim}
# simple test program (from the XML-RPC specification) # simple test program (from the XML-RPC specification)
# server = Server("http://localhost:8000") # local server # server = Server("http://localhost:8000") # local server
server = Server("http://betty.userland.com") server = Server("http://betty.userland.com")
print server print server
try: try:
print server.examples.getStateName(41) print server.examples.getStateName(41)
except Error, v: except Error, v:
print "ERROR", v print "ERROR", v
\end{verbatim} \end{verbatim}
% End