diff options
author | Fred Drake <fdrake@acm.org> | 2001-07-12 23:39:24 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2001-07-12 23:39:24 (GMT) |
commit | 5ddf7adf8420ce1a88a21f9eda75f8620ef80b92 (patch) | |
tree | 85c44ee62bc6248d558bb3e9e11ef7e3b785ade6 /Doc/lib | |
parent | ae67647ab720cb10929bfee42096efe98f96bdd7 (diff) | |
download | cpython-5ddf7adf8420ce1a88a21f9eda75f8620ef80b92.zip cpython-5ddf7adf8420ce1a88a21f9eda75f8620ef80b92.tar.gz cpython-5ddf7adf8420ce1a88a21f9eda75f8620ef80b92.tar.bz2 |
Several markup adjustments so this will format and be more consistent with
the rest of the documnentation.
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libxmlrpclib.tex | 80 |
1 files changed, 45 insertions, 35 deletions
diff --git a/Doc/lib/libxmlrpclib.tex b/Doc/lib/libxmlrpclib.tex index 0afa2aa..6c22d9e 100644 --- a/Doc/lib/libxmlrpclib.tex +++ b/Doc/lib/libxmlrpclib.tex @@ -17,17 +17,8 @@ structured data. This module supports writing XML-RPC client code; it handles all the details of translating between conformable Python objects and XML on the wire. -\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} - -\begin{classdesc}{Server}{\optional{uri\optional{, transport, encoding, verbose}}} +\begin{classdesc}{Server}{\optional{uri\optional{, transport\optional{, + encoding\optional{, verbose}}}}} A \class{Server} instance is a server proxy that manages communication with a remote XML-RPC server. The required first argument is a URI (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): \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{floating-point numbers}{Pass in directly} \lineii{strings}{Pass in directly} \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, - 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 - \class{DateTime} wrapper class} - \lineii{binary data}{pass in an instance of the \class{Binary} wrapper class} + \class{DateTime} wrapper class} + \lineii{binary data}{pass in an instance of the \class{Binary} + wrapper class} \end{tableii} 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 -errors, or a \class{ProtocolError} instance used to signal an error in -the HTTP/HTTPS transport layer. - +may also raise a special \exception{Fault} instance, used to signal +XML-RPC server errors, or \exception{ProtocolError} used to signal an +error in the HTTP/HTTPS transport layer. \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}} 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 Perl, Python and Java is available at the XML-RPC Hacks page. + \subsection{Boolean Objects \label{boolean-objects}} This class may be initialized from any Python value; the instance -returned depends onlyon its truth value. It supports various Python -operators through \class{__cmp__}, \class{__repr__}, \class{__int__}, -and \class{__nonzero__} methods, all implemented in the obvious ways. +returned depends only on its truth value. It supports various Python +operators through \method{__cmp__()}, \method{__repr__()}, +\method{__int__()}, and \method{__nonzero__()} methods, all +implemented in the obvious ways. It also has the following method, supported mainly for internal use by the unmarshalling code: @@ -134,6 +139,7 @@ the unmarshalling code: Write the XML-RPC encoding of this Boolean item to the out stream object. \end{methoddesc} + \subsection{DateTime Objects \label{datetime-objects}} 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 \method{_cmp__} and \method{__repr__} methods. + \subsection{Binary Objects \label{binary-objects}} 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} \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} It also supports certain of Python's built-in operators through a \method{_cmp__} method. + \subsection{Fault Objects \label{fault-objects}} 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. \end{memberdesc} + \subsection{ProtocolError Objects \label{protocol-error-objects}} 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. \end{memberdesc} + \subsection{Convenience Functions} \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. \end{funcdesc} -\subsection{Example of Client Usage + +\subsection{Example of Client Usage \label{xmlrpc-client-example}} \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://betty.userland.com") +# server = Server("http://localhost:8000") # local server +server = Server("http://betty.userland.com") - print server +print server - try: - print server.examples.getStateName(41) - except Error, v: - print "ERROR", v +try: + print server.examples.getStateName(41) +except Error, v: + print "ERROR", v \end{verbatim} - -% End |