XML Remote Calling Procedure
XML RPC or the XML Remote Calling Procedure is a set of compilations and implementations which allow certain programs to run on complex platforms or operating systems and allows them to make Remote Procedure calls on the Internet. The Remote Procedure Calling Protocol uses HTTP as a transport and uses XML for encoding. XML RPC allows complex data structures to be processed and transmitted or returned and it is very simple to be operated on the Internet.
The set of XML RPC implementations is spread over various operating systems like C, C++, Java, LISP, PHP just to name a few.
Understanding XML RPC
The XML RPC protocol is like any other standard protocol which the computers use to talk to each other on a network. The basic of Remote Procedure call is that one computer uses this system to run a program on the other computer it is talking to over a network. When further simplified it only means that there are clients and servers exchanging information on the network. What happens in this procedure is that the client sends a request to the serve r and then waits to receive a response for the client and then forwards the answer to the client. Then it waits for the next request to come by.
Let us take a typical working example to explain this situation. In a website which gives current temperatures all around the world, if a user asks the temperature for X place, the request is accepted and after several seconds the user is returned with an answer of what the temperature is. The transaction that takes place is simple for the server to understand. It is what the temperature is? And the temperature is amounts to a Remote Procedure Call transaction.
FTP downloads or long lived server transactions which have a session Id are not constituted as RPC transactions. RPC transactions are exchange of information in the form of transactions and not commands and instructions.
The Network file system protocol or the NFS uses the ONC RPC protocol. It is also called the Sun RPC because the Sun Networks Invented and as well marketed it. But XML RPC is a little different in functionalities from the ONC RPC. The XML RPC uses XML to encode the information and requests. The ONC RPC doesn’t have to do that and is not involved with XML in anyway. The advantage here is XML is extremely a friendly environment to work with and is user friendly interface simply because it is plain readable text and not a code.
There are a lot of servers that use XML RPC and there are many programming languages that can be used to build XML RPC based servers and clients.
Function Libraries
There are several function libraries that the XML RPC provides. But mainly the libraries are divided into C and C++. You can either use these libraries individually or you can use them together.
C libraries
The libXML RPC
The functions of the libxmlrpc can be discussed here in brief. In the libxmlRPC function the header file declares the interface and how to link to it and a lot more information. Generally the library function will either work or fail. But the distinction between these very crucial functionalities is itself little hazy as to decide what amounts to success and what amounts to failure. Because when the library actually stops functioning or doesn’t function at all it doesn’t change anything or rather nothing happens that can be distinguished from the prior scenario. However the library function does send an analytical report of how it failed.
The LibXML RPC Client
The Lib XML RPC Client uses a range of global constants as codes. Due to this the program which is running has to call a library function in order to set up the file code. However these global constants are not safe when a thread is running so you have to ensure that you should not call for this library when a thread is running in a program. However there are functions within the Client to interrupt or debug the program in case it has been used with the thread. The main usage of the LibXML RPC is when you have to run an interim part of the program and not the main program itself.
The Lib XML RPC server
An XML RPC server basically contains a machine or system which will receive the remote procedure calls and send responses to them. It uses two methods to do this and these methods are stored in the methods registry. The drivers for the protocol use this method registry to execute a XML RPC call and send a response also. These methods are called type 1 and type 2. Type 1 is usually the default. But type 2 is used more with the newer scripts because it has more advanced functionalities.
Lib XML RPC server Abyss
Abyss is nothing but a general HTTP server program that is used as a web server program. It is very similar to the apache program. The XML RPC is implemented over HTTP, with the abyss server with a handler attached the LIB XML Server abyss can execute a XML RPC call and make a connection. You can write your own Abyss request handler which will take the XML document and convert it to an XML RPC call and give the response as an XML.
Lib XML RPC server CGI
CGI or a Common Gateway Interface is used in web servers as a standard interface. This protocol is used with the web interface to perform an http request in calling a user program. For example if the HTTP makes a GET request then the server executes the GET request by sending the file with the contents named GET in it to the web server and the web server can configure a CGI program to send responses.
We know already that the XML RPC server can be implemented over HTTP, and all that is needed for an XML RPC server is a webs server that is configured to run a CGI program that knows how to execute a XML RPC call.
The C++ Libraries
LibXML RPC c++
The Lib XML RPC C++ follows some general rules as a part of its functionality. Like C++ Namespace, success/failure, memory management, naming conventions and arguments. These general helps the C++ libraries to execute the RPC in a standard way unless and until specified otherwise. It can be used as an index of rules.
Lib XML RPC Server ++
The functions are more or less like the Lib XML RPC server itself without any exceptions. Similarly it follows two methods the Type 1 and Type 2 methods and these methods are stored in methods registry. The method registry helps to forma uniform interface, so that all the methods can use this interface to interact with the protocols drivers.
Lib XML RPC Abyss ++
The server responds to the RPC calls addressed to a specific URI or the Universal resource identifier path based on the abyss http server path. There are three ways in which you can use an abyss server. They are
A TCP port number is supplied to the port and the server listens to that port to receive the remote procedure calls.
A TCP socket can be supplied and the server listens to the port to receive calls for that socket from XML RPC clients.
You can also supply sockets which are pre connected and the server listens to these sockets for calls from XML RPC Clients. However the simplest thing to do here is configure an Abyss server and let it carry out the rest of the procedure.
Lib XML RPC Server Pstream ++.
This is the only library function which is different from the c libraries. The functionality of this library is to send the information in packets and stream them in an order. This program handles every server connection individually, that is after completing streaming one server connection it exits and then restarts. It depends on the Transmission Control Protocol connection for the client as a connection standard. In order to handle to a series of server connections you should configure to accept TCP connections.
A Packet stream is far easier than HTTP to handle. HTTP itself is simple and the packet stream is simpler and very easy. It is probably the simplest way to communicate XML RPC messages. A packet stream is a two way communication method which consists of information packets which are traveling in both directions. A packet stream is nothing but a stream of bytes and this stream of bytes can be different in size that is each individual packet may be of a different size. Each of these packets has a unique connection with the Socket stream or the TCP connection. Each XML RPC message amounts to one packet in XML RPC Packet Stream. And all these individual packet streams are connected to each other.