Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Apress.Pro.Drupal.7.Development.3rd.Edition.Dec.2010.pdf
Скачиваний:
74
Добавлен:
14.03.2016
Размер:
13 Мб
Скачать
☆

C H A P T E R 2 0

■ ■ ■

XML-RPC

Drupal “plays well with others.” That is, if there’s an open standard out there, chances are that Drupal supports it either natively or through a contributed module. XML-RPC is no exception; Drupal supports it natively. In this chapter, you’ll learn how to take advantage of Drupal’s ability both to send and receive XML-RPC calls.

What Is XML-RPC?

A remote procedure call is when one program asks another program to execute a function. XML-RPC is a standard for remote procedure calls where the call is encoded with XML and sent over HTTP. The XMLRPC protocol was created by Dave Winer of UserLand Software in collaboration with Microsoft (see www.xmlrpc.com/spec). It’s specifically targeted at distributed web-based systems talking to each other, as when one Drupal site asks another Drupal site for some information.

There are two players when XML-RPC happens. One is the site from which the request originates, known as the client. The site that receives the request is the server.

Prerequisites for XML-RPC

If your site will be acting only as a server, there’s nothing to worry about because incoming XML-RPC requests use the standard web port (usually port 80). The file xmlrpc.php in your Drupal installation contains the code that’s run for an incoming XML-RPC request. It’s known as the XML-RPC endpoint.

■ Note Some people add security through obscurity by renaming the xmlrpc.php file to change their XML-RPC endpoint. This prevents evil wandering robots from probing the server’s XML-RPC interfaces. Others delete it altogether if the site isn’t accepting XML-RPC requests.

451

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]