XML-RPC learning notes (1)

xiaoxiao2021-03-05  30

I have to learn XML-RPC learning is starting from Eric Kidd's XML-RPC HOWTO. The following is the original address, directly watching English original effects.

http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto.html

The full name of the XML-RPC is XML Remote Procedure Call, which is the XML remote method call, the names, the use of XML as a medium that calls the remote method. Due to the simplicity of XML, it is relatively easy to use XML-RPC.

The following Python code is given, demonstrate an XML-RPC application:

Python> IMPORT XMLRPCLIB PYTHON> Server = XmlrpClib.server ("http://betty.userland.com/rpc2") Python> Server.examples.getStateName (41) 'South Dakota'

Very simple function call.

The manual of the XML-RPC protocol is http://www.xmlrpc.com/spec, the author is Dave Winer. Interested in referring to the reference, the following posts a simple XML for communication.

Sample.SumAndDifference 5 3

XML-RPC itself supports many data types, below is the list of data types he supported:

INT: Have a symbol 32-bit integer

String: ASCII string, you can contain null bytes. (In fact, many XML-RPC support Unicode, this is due to the potential features of XML.)

Boolean: True or False

Double: Double precision floating point

DateTime.ISO8601: Date, unfortunately, since XML-RPC is prohibited from using the time zone, this is rarely used.

Base64: Original binary data of any length; use Base64 algorithm code, very useful.

Array: One-dimensional array

Struct: A set of "key-value" pairs, "key" is a string, "value" can be any type.

XML-RPC history reference http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-history.html

转载请注明原文地址:https://www.9cbs.com/read-33968.html

New Post(0)