Wednesday, November 12, 2008


Apache XML-RPC is a Java implementation of XML-RPC, a popular protocol that uses XML over HTTP to implement remote procedure calls.
1.Client class
XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
config.setServerURL(new URL(""));
XmlRpcClient client = new XmlRpcClient();
Object[] params = new Object[]{new Integer(33), new Integer(9)};
Integer result = (Integer) client.execute("Calculator.add", params);

2.Server Class
public class Calculator {
public int add(int i1, int i2) {
return i1 + i2;
public int subtract(int i1, int i2) {
return i1 - i2;

3. Create Propert File
Create a property file, which contains at least one property. The property name is arbitrary, and the property value is the fully qualified name of the Calculator class. For example, like that:
The property file must be called, and it must be located in the package org.apache.xmlrpc.webserver. In other words, you would typically put it into the directory org/apache/xmlrpc/webserver and add it to your jar file.

4. Add Entry to Web.xml
<servlet-name> XmlRpcServlet</servlet-name>
<description> Sets, whether the servlet supports vendor extensions for XML-RPC. </description>

No comments:

Free Domain Names @!