When either of those are received, they will be mapped to the class and method on the right. The allowed methods are on the left side of the array. The above example contains an array specifying two method requests that the Server allows. $config = array('function' => ' My_blog.update_entry') $config = array('function' => ' My_blog.new_entry'), Request to appear, then setting up an array with mapping instructions so that incoming requests can be sent to the appropriate To create your own XML-RPC server involves initializing the XML-RPC Server class in your controller where you expect the incoming The Data Types section below has a full list of data types.Īn XML-RPC Server acts as a traffic cop of sorts, waiting for incoming requests and redirecting them to the If you use data types other than strings, or if you have several different data types, you will placeĮach parameter into its own array, with the data type in the second position: Here is an example of a simple array with three parameters: $request = array('John', 'Doe', '$this->xmlrpc->request($request) You will have to include the data type in the request array. If your parameters are something other than strings Of seven data types (strings, numbers, dates, etc.). Request parameters must be placed into an array for transportation, and each parameter can be one When the XML-RPC server receives your request, it will look for parameters it requires. Anatomy of a RequestĪn XML-RPC request is simply the data you are sending to the XML-RPC server. If the send_request() method returns false we will display the error message Request (in this case, the title and URL of your site) is placed into an array for transportation, and The above code initializes the XML-RPC class, sets the server URL and method to be called (weblogUpdates.ping). $this->xmlrpc->method('weblogUpdates.ping') Here is a basic example that sends a simple ping to the Ping-o-Matic $this->load->library('xmlrpc') The method on the server you wish to call.To send a request to an XML-RPC server you must specify the following information: Note: When using the XML-RPC Server class you must load BOTH the XML-RPC class and the XML-RPC Server class. Once loaded, the xml-rpcs library object will be available using: $this->xmlrpcs To load the XML-RPC Server class you will use: Once loaded, the xml-rpc library object will be available using: $this->xmlrpc To load the XML-RPC class you will use: $this->load->library('xmlrpc') Like most other classes in CodeIgniter, the XML-RPC and XML-RPCS classes are initialized in your controller using the $this->load->library function: Once processed, the server will then send back a response message.įor detailed specifications, you can visit the XML-RPC site. When the XML-RPC Server receives this request it will examine it to determine which class/method should be called to process the request. This request might be a new weblog entryīeing sent for publication, or it could be a request for an existing entry for editing. Send a request to an XML-RPC Server running on your site. Once the server receives and processes the request itįor example, using the MetaWeblog API, an XML-RPC Client (usually a desktop publishing tool) will One computer, which we will call the client, sends an XML-RPC request toĪnother computer, which we will call the server. Quite simply it is a way for two computers to communicate over the internet using XML. Your own XML-RPC server to receive requests. CodeIgniter's XML-RPC classes permit you to send requests to another server, or set up
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |