MENU
XML RPC
XML Remote Procedure Call (XML-RPC) uses XML to encode calls and HTTP for transport. "XML-RPC" also refers, in general, to the use of XML for remote procedure calls, independently of the specific protocol.XML-RPC works by sending an HTTP request to a server. Multiple input parameters can be supplied, and one value is returned. These input and output parameters can contain larger structures like lists and maps.
REST transports resources such as documents, while XML-RPC deals with method calls. XML-RPC is simpler than SOAP because XML-RPC:
- uses one method of method serialization, whereas SOAP defines multiple varying encodings.
- has simpler security operations.
- does not use WSDL, although XRDL provides a subset of WSDL.
<?xml version="1.0"?>
<methodCall>
<methodName>examples.getStateName</methodName>
<params>
<param>
<value><i4>100</i4></value>
</param>
</params>
</methodCall><?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value><string>Chong Lip Phang</string></value>
</param>
</params>
</methodResponse><?xml version="1.0"?>
<methodResponse>
<fault>
<value>
<struct>
<member>
<name>faultCode</name>
<value><int>4</int></value>
</member>
<member>
<name>faultString</name>
<value><string>Too many parameters.</string></value>
</member>
</struct>
</value>
</fault>
</methodResponse>