Answers

Question and Answer:

  Home  WordPress Theme Development

⟩ Explain me what is XML-RPC?

Overview

XML-RPC is a Remote Procedure Calling protocol that works over the Internet.

An XML-RPC message is an HTTP-POST request. The body of the request is in XML. A procedure executes on the server and the value it returns is also formatted in XML.

Procedure parameters can be scalars, numbers, strings, dates, etc.; and can also be complex record and list structures.

Request example

☛ Here’s an example of an XML-RPC request:

☛ POST /RPC2 HTTP/1.0

☛ User-Agent: Frontier/5.1.2 (WinNT)

☛ Host: betty.userland.com

☛ Content-Type: text/xml

☛ Content-length: 181

☛ examples.getStateName 41

☛ Header requirements

The format of the URI in the first line of the header is not specified. For example, it could be empty, a single slash, if the server is only handling XML-RPC calls. However, if the server is handling a mix of incoming HTTP requests, we allow the URI to help route the request to the code that handles XML-RPC requests. (In the example, the URI is /RPC2, telling the server to route the request to the “RPC2″ responder.)

A User-Agent and Host must be specified.

The Content-Type is text/xml.

The Content-Length must be specified and must be correct.

Payload format

The payload is in XML, a single structure.

The must contain a sub-item, a string, containing the name of the method to be called. The string may only contain identifier characters, upper and lower-case A-Z, the numeric characters, 0-9, underscore, dot, colon and slash. It’s entirely up to the server to decide how to interpret the characters in a methodName.

For example, the methodName could be the name of a file containing a script that executes on an incoming request. It could be the name of a cell in a database table. Or it could be a path to a file contained within a hierarchy of folders and files.

If the procedure call has parameters, the must contain a sub-item. The sub-item can contain any number of s, each of which has a .

Scalar s

s can be scalars, type

 143 views

More Questions for you: