From 1f622294b92c095fd91e8ca44912d405c1605ded Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Thu, 7 Apr 2011 12:06:51 -0400 Subject: Wow, I screwed that up, Reactor is going to 2.0.2 not 2.0.1 --- user_guide/libraries/xmlrpc.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'user_guide/libraries/xmlrpc.html') diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 53931aee7..5ba851341 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -28,7 +28,7 @@
- +

CodeIgniter User Guide Version 2.0.1

CodeIgniter User Guide Version 2.0.2

-- cgit v1.2.3-24-g4f1b From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001 From: Razican Date: Mon, 25 Apr 2011 17:26:45 +0200 Subject: Fixed double-space typo. --- user_guide/libraries/xmlrpc.html | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'user_guide/libraries/xmlrpc.html') diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html index 5ba851341..f7aa6fe42 100644 --- a/user_guide/libraries/xmlrpc.html +++ b/user_guide/libraries/xmlrpc.html @@ -67,11 +67,11 @@ your own XML-RPC server to receive requests.

Quite simply it is a way for two computers to communicate over the internet using XML. One computer, which we will call the client, sends an XML-RPC request to -another computer, which we will call the server. Once the server receives and processes the request it +another computer, which we will call the server. Once the server receives and processes the request it will send back a response to the client.

For example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will -send a request to an XML-RPC Server running on your site. This request might be a new weblog entry +send a request to an XML-RPC Server running on your site. This request might be a new weblog entry being sent for publication, or it could be a request for an existing entry for editing. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. @@ -127,16 +127,16 @@ if ( ! $this->xmlrpc->send_request())

Explanation

-

The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The +

The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). The request (in this case, the title and URL of your site) is placed into an array for transportation, and compiled using the request() function. -Lastly, the full request is sent. If the send_request() method returns false we will display the error message +Lastly, the full request is sent. If the send_request() method returns false we will display the error message sent back from the XML-RPC Server.

Anatomy of a Request

-

An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request -is referred to as a request parameter. The above example has two parameters: +

An XML-RPC request is simply the data you are sending to the XML-RPC server. Each piece of data in a request +is referred to as a request parameter. The above example has two parameters: The URL and title of your site. When the XML-RPC server receives your request, it will look for parameters it requires.

Request parameters must be placed into an array for transportation, and each parameter can be one @@ -161,7 +161,7 @@ $request = array (

$this->xmlrpc->request($request); -The Data Types section below has a full list of data types. +The Data Types section below has a full list of data types. @@ -198,7 +198,7 @@ server will load the My_blog class and call the new_entry If the request is for the update_post method, your server will load the My_blog class and call the update_entry function.

-

The function names in the above example are arbitrary. You'll decide what they should be called on your server, +

The function names in the above example are arbitrary. You'll decide what they should be called on your server, or if you are using standardized APIs, like the Blogger or MetaWeblog API, you'll use their function names.

There are two additional configuration keys you may make use of when initializing the server class: debug can be set to TRUE in order to enable debugging, and xss_clean may be set to FALSE to prevent sending data through the Security library's xss_clean function. @@ -221,12 +221,12 @@ to exist with this prototype:

The $request variable is an object compiled by the Server, which contains the data sent by the XML-RPC Client. -Using this object you will have access to the request parameters enabling you to process the request. When +Using this object you will have access to the request parameters enabling you to process the request. When you are done you will send a Response back to the Client.

-

Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). +

Below is a real-world example, using the Blogger API. One of the methods in the Blogger API is getUserInfo(). Using this method, an XML-RPC Client can send the Server a username and password, in return the Server sends -back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing +back information about that particular user (nickname, user ID, email address, etc.). Here is how the processing function might look:

@@ -272,14 +272,14 @@ In the above example, the output parameters will be the username and password.Formatting a Response -

Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array -that contains a single item. This item can be an array with several additional arrays, but there -can be only one primary array index. In other words, the basic prototype is this:

+

Similar to Requests, Responses must be formatted as an array. However, unlike requests, a response is an array +that contains a single item. This item can be an array with several additional arrays, but there +can be only one primary array index. In other words, the basic prototype is this:

-$response = array('Response data', 'array'); +$response = array('Response data', 'array');

Responses, however, usually contain multiple pieces of information. In order to accomplish this we must put the response into its own -array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

+array so that the primary array continues to contain a single piece of data. Here's an example showing how this might be accomplished:

$response = array (
@@ -293,9 +293,9 @@ $response = array (
                 );
-

Notice that the above array is formatted as a struct. This is the most common data type for responses.

+

Notice that the above array is formatted as a struct. This is the most common data type for responses.

-

As with Requests, a response can be one of the seven data types listed in the Data Types section.

+

As with Requests, a response can be one of the seven data types listed in the Data Types section.

Sending an Error Response

@@ -314,7 +314,7 @@ $response = array (

Creating Your Own Client and Server

To help you understand everything we've covered thus far, let's create a couple controllers that act as -XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

+XML-RPC Client and Server. You'll use the Client to send a request to the Server and receive a response.

The Client

@@ -352,7 +352,7 @@ class Xmlrpc_client extends CI_Controller { } ?> -

Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

+

Note: In the above code we are using a "url helper". You can find more information in the Helpers Functions page.

The Server

@@ -381,7 +381,7 @@ class Xmlrpc_server extends CI_Controller { $response = array( array( - 'you_said' => $parameters['0'], + 'you_said' => $parameters['0'], 'i_respond' => 'Not bad at all.'), 'struct'); @@ -452,7 +452,7 @@ The Server receives the request and maps it to the "process" function, where a r $this->xmlrpc->request($request);

$this->xmlrpc->send_request()

-

The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

+

The request sending function. Returns boolean TRUE or FALSE based on success for failure, enabling it to be used conditionally.

$this->xmlrpc->set_debug(TRUE);

Enables debugging, which will display a variety of information and error data helpful during development.

@@ -463,7 +463,7 @@ $this->xmlrpc->request($request); echo $this->xmlrpc->display_error();

$this->xmlrpc->display_response()

-

Returns the response from the remote server once request is received. The response will typically be an associative array.

+

Returns the response from the remote server once request is received. The response will typically be an associative array.

$this->xmlrpc->display_response();

$this->xmlrpc->send_error_message()

-- cgit v1.2.3-24-g4f1b