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
5ddf7adf
Commit
5ddf7adf
authored
Jul 12, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several markup adjustments so this will format and be more consistent with
the rest of the documnentation.
parent
ae67647a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
35 deletions
+45
-35
Doc/lib/libxmlrpclib.tex
Doc/lib/libxmlrpclib.tex
+45
-35
No files found.
Doc/lib/libxmlrpclib.tex
View file @
5ddf7adf
...
...
@@ -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 supplie
s
}
\lineii
{
boolean
}{
The
\constant
{
True
}
and
\constant
{
False
}
constant
s
}
\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
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