Author: Seek ruler Build Source: Http://www.sentom.netXML-RPC is a remote procedure call protocol that works on the Internet. Popular point, is the use of HTTP protocol interaction, the interaction of the carrier is an XML file. XML-RPC Specific specifications please refer to here.
Photo from XML-RPC official website
The XML-RPC specification defines six data types, and the following table is the corresponding table of the six data types and Java data types.
Xml-rpcjava<i4> or <int>int<boolean>boolean<string>java.lang.string<double>double <datetime.iso8601>java.util.date<struct>java.util.hashtable<array>java.util.vector<base64 >byte[]
XML-RPC specification of various platforms are implemented concretely, XML-RPC specification Java implementation has several kinds, here we chose Apache XML-RPC.
The XML-RPC server implementation first defines a simple business object MyHandler, and the remote client invokes the object's method, as follows:
Xmlrpc.addhandler ("MyHandler", New MyHandler ());
For ease of understanding, this can be seen as common:
MyHandler MyHandler = new MyHandler ();
Finally, add the following lines to the Web.xml file:
<servlet> <servlet-name>MyXmlRpcServer</servlet-name> <servlet-class> Net.sentom.xmlrpc.myxmlrpcserver</servlet-class></servlet><servlet-mapping> <servlet-name >MyXmlRpcServer</servlet-name> <url-pattern>/myxmlrpcserver</url-pattern></ Servlet-mapping>
XML-RPC Client implementation of the client is relatively simple, first to a Java client implementation myxmlrpcclient:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.