SlideShare a Scribd company logo
3
Most read
5
Most read
7
Most read
Š Peter R. Egli 2015
1/11
Rev. 1.60
XML-RPC indigoo.com
INTRODUCTION TO XML-RPC,
A SIMPLE XML-BASED RPC MECHANISM
XML-RPC
Peter R. Egli
INDIGOO.COM
Š Peter R. Egli 2015
2/11
Rev. 1.60
XML-RPC indigoo.com
Contents
1. What is XML-RPC?
2. XML-RPC architecture
3. XML-RPC protocol
4. XML-RPC server implementation in Java
5. Where to use XML-RPC
Š Peter R. Egli 2015
3/11
Rev. 1.60
XML-RPC indigoo.com
1. What is XML-RPC?
XML-RPC is a remote procedure call protocol using XML as data format and HTTP as transport
protocol.
Advantages of XML-RPC:
• Simple mechanism to call remote procedures on a machine with a different OS.
• XML-RPC is language and platform independent. XML-RPC libraries are available in Java
and other languages (e.g. .Net: http://xml-rpc.net/).
• XML-RPC is not more than its name implies and thus is very simple and lean (very short
specification, see http://xmlrpc.scripting.com/spec.html).
Protocols and techniques behind XML-RPC:
1. XML - Formatting of the request and response and the arguments (wire protocol)
2. RPC - Remote call of procedures.
3. HTTP - Transport protocol for the XML („firewall-friendly“).
<methodCall>
…
</methodCall>
HTTP HTTP
<methodResponse>
…
</methodResponse>
XML-
RPC
server
XML-
RPC
client
<methodCall>
…
</methodCall>
<methodResponse>
…
</methodResponse>
Š Peter R. Egli 2015
4/11
Rev. 1.60
XML-RPC indigoo.com
2. XML-RPC architecture
The client application accesses the server through a URL (= location where service resides).
The XML-RPC listener receives requests and passes these to the handler (= user defined class
servicing the request).
Client
application
XML-RPC
HTTP
TCP
IP
XML-RPC
HTTP
TCP
IP
XML-RPC
Handler
XML-RPC
listener
service.method call
response
XML request
XML reply
HTTP POST
HTTP reply
Š Peter R. Egli 2015
5/11
Rev. 1.60
XML-RPC indigoo.com
3. XML-RPC protocol (1/5)
Request (example from www.xmlrpc.com/spec):
• The XML body of the HTTP request contains a single method call (getStateName).
• The method is called on a service name under which the method is available.
• The URL does not need to be specified (service is indicated by the string before the dot
in the method name element).
POST /RPC2 HTTP/1.0
User-Agent: Frontier/5.1.2 (WinNT)
Host: betty.userland.com
Content-Type: text/xml
Content-length: 181
<?xml version="1.0"?>
<methodCall>
<methodName>examples.getStateName</methodName>
<params>
<param>
<value>
<i4>41</i4>
</value>
</param>
</params>
</methodCall>
HTTP header (request)
with required header fields (blue)
XML body
List of request
parameters
Š Peter R. Egli 2015
6/11
Rev. 1.60
XML-RPC indigoo.com
List of
return
values
3. XML-RPC protocol (2/5)
Response (example from www.xmlrpc.com/spec):
• The HTTP return code is always „200 OK“, even in case of an XML-RPC fault (see below).
• The response contains a single value (like a return argument of a local procedure call).
HTTP/1.1 200 OK
Connection: close
Content-Length: 158
Content-Type: text/xml
Date: Fri, 17 Jul 1998 19:55:08 GMT
Server: UserLand Frontier/5.1.2-WinNT
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value>
<string>South Dakota</string>
</value>
</param>
</params>
</methodResponse>
HTTP header (response)
with required header fields (blue)
XML body
Š Peter R. Egli 2015
7/11
Rev. 1.60
XML-RPC indigoo.com
3. XML-RPC protocol (3/5)
Response with a failure (example from www.xmlrpc.com/spec):
• Even in case of an XML-RPC level failure the HTTP return code is 200 OK.
• The failure is indicated with the <fault> element.
HTTP/1.1 200 OK
Connection: close
Content-Length: 426
Content-Type: text/xml
Date: Fri, 17 Jul 1998 19:55:02 GMT
Server: UserLand Frontier/5.1.2-WinNT
<?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>
Š Peter R. Egli 2015
8/11
Rev. 1.60
XML-RPC indigoo.com
3. XML-RPC protocol (4/5)
Parameter types (1/2):
Base types:
XML-RPC has a very limited set of base types:
Type Description Example
<i4> or <int> Four-byte signed integer -12
<boolean> 0 (false) or 1 (true) 1
<string> ASCII string (string is default) Hi!
<double> Double-precision 3.1415
<dateTime.iso8601> Date/time 19980717T14:08:55
<base64> Base64-encoded binary eW91IGNhbid
Structs:
Structs contain elements (<member>) with a <name> and <value> element ("named" values).
Structs may be recursive (value in a struct may be a struct again).
<struct>
<member>
<name>lowerBound</name>
<value><i4>18</i4></value>
</member>
<member>
<name>upperBound</name>
<value><i4>139</i4></value>
</member>
</struct>
Š Peter R. Egli 2015
9/11
Rev. 1.60
XML-RPC indigoo.com
3. XML-RPC protocol (5/5)
Parameter types (2/2):
Arrays:
An array contains a single <data> element that in turn contains an array of <value> elements.
An array differs from a struct in that its elements are simple values (without <name> element).
Arrays may be recursive (value in array may be an array or also a struct).
<array>
<data>
<value><i4>12</i4></value>
<value><string>Egypt</string></value>
<value><boolean>0</boolean></value>
<value><i4>-31</i4></value>
</data>
</array>
Š Peter R. Egli 2015
10/11
Rev. 1.60
XML-RPC indigoo.com
4. XML-RPC server implementation in Java
The class loader provides lookup service (find the serving class from request name).
The XML-RPC listener does unmarshalling / marshalling of parameters.
The XML-RPC handler is the user class that handles the request (implementation of the
actual procedure call).
WebServer
XML-RPC
listener
Classloader
properties
Load mapping into
class loader
XML-RPC
handler
(user class)
Defines the mapping
from service name
to class name serving
the requests
HTTP protocol
front-end
Passes the request to
the XML-RPC server
Consults class
loader to get
the serving class
Unpack the XML, get the serving
class, convert the arguments (C  S)
Pack the response into XML (S  C)
Pass the request
to the serving
class
HTTP
Š Peter R. Egli 2015
11/11
Rev. 1.60
XML-RPC indigoo.com
5. Where to use XML-RPC
• XML-RPC may be suited for simple applications or situations where clients implemented in
different technologies need to interact with a server with simple read-write operations where
a more complex middleware technology would be overkill.
• XML-RPC is a solution to integrate different platforms with a simple middleware.
• XML-RPC is very simple so it can be implemented also for platforms without open source or
commercially available XML-RPC libraries.
Java
PL/1
C++
RMI / IIOP
CORBA
DCOM
CORBA
runtime
DCOM
runtime
C++
Integration of different
platforms leads to complexity
on the server side
Java
PL/1
C++
XML-RPC
runtime
C++ XML-RPC as a common integration
technology reduces complexity on
the server side (but adds complexity
on the client side)
XML-RPC
stub
HTTP

More Related Content

PPTX
Java - Sockets
Riccardo Cardin
 
PDF
Alpha & Beta Testing
Mithilesh Singh
 
PDF
Software testing methods, levels and types
Confiz
 
PPTX
Socket programming in Java (PPTX)
UC San Diego
 
PPTX
Software testing
Bhagyashree pathak
 
PDF
Integration test
sadegh salehi
 
PDF
Local Service Search Engine Management System LSSEMS
YogeshIJTSRD
 
PPTX
Software testing
balamurugan.k Kalibalamurugan
 
Java - Sockets
Riccardo Cardin
 
Alpha & Beta Testing
Mithilesh Singh
 
Software testing methods, levels and types
Confiz
 
Socket programming in Java (PPTX)
UC San Diego
 
Software testing
Bhagyashree pathak
 
Integration test
sadegh salehi
 
Local Service Search Engine Management System LSSEMS
YogeshIJTSRD
 
Software testing
balamurugan.k Kalibalamurugan
 

What's hot (20)

PDF
Black Box Testing
Testbytes
 
PDF
Network programming Using Python
Karim Sonbol
 
PPT
C sharp
Satish Verma
 
PDF
TELNET Protocol
Peter R. Egli
 
PPT
Asp.net.
Naveen Sihag
 
PDF
Introduction to flutter
Wan Muzaffar Wan Hashim
 
DOCX
Mail Server Project Report
Kavita Sharma
 
PPTX
Basics of Object Oriented Programming
Abhilash Nair
 
PPTX
Introduction to selenium
Archana Krushnan
 
PPTX
Waterfall model ppt final
shiva krishna
 
PPTX
Transport Layer
Dr Shashikant Athawale
 
PDF
Dc ch02 : protocol architecture
Syaiful Ahdan
 
PPTX
Automation - web testing with selenium
Tzirla Rozental
 
PPTX
Object Oriented Analysis (Coad-Yourdon)
Subash Khatiwada
 
PPTX
Android Studio Overview
Salim Hosen
 
PPTX
Software testing.ppt
Komal Garg
 
PPTX
Manipulation strings in c++
SeethaDinesh
 
PPTX
Web services SOAP
princeirfancivil
 
PPTX
Java file
sonnetdp
 
Black Box Testing
Testbytes
 
Network programming Using Python
Karim Sonbol
 
C sharp
Satish Verma
 
TELNET Protocol
Peter R. Egli
 
Asp.net.
Naveen Sihag
 
Introduction to flutter
Wan Muzaffar Wan Hashim
 
Mail Server Project Report
Kavita Sharma
 
Basics of Object Oriented Programming
Abhilash Nair
 
Introduction to selenium
Archana Krushnan
 
Waterfall model ppt final
shiva krishna
 
Transport Layer
Dr Shashikant Athawale
 
Dc ch02 : protocol architecture
Syaiful Ahdan
 
Automation - web testing with selenium
Tzirla Rozental
 
Object Oriented Analysis (Coad-Yourdon)
Subash Khatiwada
 
Android Studio Overview
Salim Hosen
 
Software testing.ppt
Komal Garg
 
Manipulation strings in c++
SeethaDinesh
 
Web services SOAP
princeirfancivil
 
Java file
sonnetdp
 
Ad

Viewers also liked (6)

PPTX
Webservices Overview : XML RPC, SOAP and REST
Pradeep Kumar
 
PDF
SOAP vs REST
MĂĄrio Almeida
 
PPTX
Web services - A Practical Approach
Madhaiyan Muthu
 
PPT
Mule ESB
niravn
 
DOCX
Matrimonial web site Documentation
home
 
PPT
Web Service Presentation
guest0df6b0
 
Webservices Overview : XML RPC, SOAP and REST
Pradeep Kumar
 
SOAP vs REST
MĂĄrio Almeida
 
Web services - A Practical Approach
Madhaiyan Muthu
 
Mule ESB
niravn
 
Matrimonial web site Documentation
home
 
Web Service Presentation
guest0df6b0
 
Ad

Similar to XML-RPC (XML Remote Procedure Call) (20)

PDF
xml rpc
Varun Garg
 
PDF
XML-RPC and SOAP (April 2003)
Kiran Jonnalagadda
 
KEY
A Conversation About REST
Mike Wilcox
 
KEY
A Conversation About REST
Jeremy Brown
 
KEY
A Conversation About REST - Extended Version
Jeremy Brown
 
PPT
jkljklj
hoefo
 
PPTX
Communication Protocols And Web Services
Omer Katz
 
PDF
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
PPT
Bottom-Line Web Services
Mohammed Makhlouf
 
PDF
Download
Jaya Kulchandani
 
DOC
Use perl creating web services with xml rpc
Johnny Pork
 
PPTX
Introduction to gRPC Presentation (Java)
Knoldus Inc.
 
PDF
Web Service Interaction Models | Torry Harris Whitepaper
Torry Harris Business Solutions
 
PPTX
Introduction to gRPC (Application) Presentation
Knoldus Inc.
 
PPTX
The new (is it really ) api stack
Red Hat
 
PPT
ghfghg
hoefo
 
PDF
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
apidays
 
PPT
Intro to web services
Neil Ghosh
 
PPTX
Communication Mechanisms, Past, Present & Future
Muhammad Ali
 
PDF
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Mustafa AKIN
 
xml rpc
Varun Garg
 
XML-RPC and SOAP (April 2003)
Kiran Jonnalagadda
 
A Conversation About REST
Mike Wilcox
 
A Conversation About REST
Jeremy Brown
 
A Conversation About REST - Extended Version
Jeremy Brown
 
jkljklj
hoefo
 
Communication Protocols And Web Services
Omer Katz
 
apidays LIVE Helsinki - Implementing OpenAPI and GraphQL Services with gRPC b...
apidays
 
Bottom-Line Web Services
Mohammed Makhlouf
 
Download
Jaya Kulchandani
 
Use perl creating web services with xml rpc
Johnny Pork
 
Introduction to gRPC Presentation (Java)
Knoldus Inc.
 
Web Service Interaction Models | Torry Harris Whitepaper
Torry Harris Business Solutions
 
Introduction to gRPC (Application) Presentation
Knoldus Inc.
 
The new (is it really ) api stack
Red Hat
 
ghfghg
hoefo
 
APIdays Helsinki 2019 - gRPC: Lightning Fast, Self-Documenting APIs with Moha...
apidays
 
Intro to web services
Neil Ghosh
 
Communication Mechanisms, Past, Present & Future
Muhammad Ali
 
Building Language Agnostic APIs with gRPC - JavaDay Istanbul 2017
Mustafa AKIN
 

More from Peter R. Egli (20)

PDF
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
Peter R. Egli
 
PDF
Data Networking Concepts
Peter R. Egli
 
PDF
Communication middleware
Peter R. Egli
 
PDF
Transaction Processing Monitors (TPM)
Peter R. Egli
 
PDF
Business Process Model and Notation (BPMN)
Peter R. Egli
 
PDF
Microsoft .NET Platform
Peter R. Egli
 
PDF
Overview of Cloud Computing
Peter R. Egli
 
PDF
MQTT - MQ Telemetry Transport for Message Queueing
Peter R. Egli
 
PDF
Enterprise Application Integration Technologies
Peter R. Egli
 
PDF
Overview of Microsoft .Net Remoting technology
Peter R. Egli
 
PDF
Android Native Development Kit
Peter R. Egli
 
PDF
Overview of SCTP (Stream Control Transmission Protocol)
Peter R. Egli
 
PDF
Overview of SCTP (Stream Control Transmission Protocol)
Peter R. Egli
 
PDF
Web services
Peter R. Egli
 
PDF
Overview of Spanning Tree Protocol (STP & RSTP)
Peter R. Egli
 
PDF
MSMQ - Microsoft Message Queueing
Peter R. Egli
 
PDF
Common Object Request Broker Architecture - CORBA
Peter R. Egli
 
PDF
Component Object Model (COM, DCOM, COM+)
Peter R. Egli
 
PDF
JMS - Java Messaging Service
Peter R. Egli
 
PDF
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
Peter R. Egli
 
Data Networking Concepts
Peter R. Egli
 
Communication middleware
Peter R. Egli
 
Transaction Processing Monitors (TPM)
Peter R. Egli
 
Business Process Model and Notation (BPMN)
Peter R. Egli
 
Microsoft .NET Platform
Peter R. Egli
 
Overview of Cloud Computing
Peter R. Egli
 
MQTT - MQ Telemetry Transport for Message Queueing
Peter R. Egli
 
Enterprise Application Integration Technologies
Peter R. Egli
 
Overview of Microsoft .Net Remoting technology
Peter R. Egli
 
Android Native Development Kit
Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Peter R. Egli
 
Web services
Peter R. Egli
 
Overview of Spanning Tree Protocol (STP & RSTP)
Peter R. Egli
 
MSMQ - Microsoft Message Queueing
Peter R. Egli
 
Common Object Request Broker Architecture - CORBA
Peter R. Egli
 
Component Object Model (COM, DCOM, COM+)
Peter R. Egli
 
JMS - Java Messaging Service
Peter R. Egli
 
Web Services (SOAP, WSDL, UDDI)
Peter R. Egli
 

Recently uploaded (20)

PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Doc9.....................................
SofiaCollazos
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Software Development Methodologies in 2025
KodekX
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
The Future of Artificial Intelligence (AI)
Mukul
 

XML-RPC (XML Remote Procedure Call)

  • 1. Š Peter R. Egli 2015 1/11 Rev. 1.60 XML-RPC indigoo.com INTRODUCTION TO XML-RPC, A SIMPLE XML-BASED RPC MECHANISM XML-RPC Peter R. Egli INDIGOO.COM
  • 2. Š Peter R. Egli 2015 2/11 Rev. 1.60 XML-RPC indigoo.com Contents 1. What is XML-RPC? 2. XML-RPC architecture 3. XML-RPC protocol 4. XML-RPC server implementation in Java 5. Where to use XML-RPC
  • 3. Š Peter R. Egli 2015 3/11 Rev. 1.60 XML-RPC indigoo.com 1. What is XML-RPC? XML-RPC is a remote procedure call protocol using XML as data format and HTTP as transport protocol. Advantages of XML-RPC: • Simple mechanism to call remote procedures on a machine with a different OS. • XML-RPC is language and platform independent. XML-RPC libraries are available in Java and other languages (e.g. .Net: http://xml-rpc.net/). • XML-RPC is not more than its name implies and thus is very simple and lean (very short specification, see http://xmlrpc.scripting.com/spec.html). Protocols and techniques behind XML-RPC: 1. XML - Formatting of the request and response and the arguments (wire protocol) 2. RPC - Remote call of procedures. 3. HTTP - Transport protocol for the XML („firewall-friendly“). <methodCall> … </methodCall> HTTP HTTP <methodResponse> … </methodResponse> XML- RPC server XML- RPC client <methodCall> … </methodCall> <methodResponse> … </methodResponse>
  • 4. Š Peter R. Egli 2015 4/11 Rev. 1.60 XML-RPC indigoo.com 2. XML-RPC architecture The client application accesses the server through a URL (= location where service resides). The XML-RPC listener receives requests and passes these to the handler (= user defined class servicing the request). Client application XML-RPC HTTP TCP IP XML-RPC HTTP TCP IP XML-RPC Handler XML-RPC listener service.method call response XML request XML reply HTTP POST HTTP reply
  • 5. Š Peter R. Egli 2015 5/11 Rev. 1.60 XML-RPC indigoo.com 3. XML-RPC protocol (1/5) Request (example from www.xmlrpc.com/spec): • The XML body of the HTTP request contains a single method call (getStateName). • The method is called on a service name under which the method is available. • The URL does not need to be specified (service is indicated by the string before the dot in the method name element). POST /RPC2 HTTP/1.0 User-Agent: Frontier/5.1.2 (WinNT) Host: betty.userland.com Content-Type: text/xml Content-length: 181 <?xml version="1.0"?> <methodCall> <methodName>examples.getStateName</methodName> <params> <param> <value> <i4>41</i4> </value> </param> </params> </methodCall> HTTP header (request) with required header fields (blue) XML body List of request parameters
  • 6. Š Peter R. Egli 2015 6/11 Rev. 1.60 XML-RPC indigoo.com List of return values 3. XML-RPC protocol (2/5) Response (example from www.xmlrpc.com/spec): • The HTTP return code is always „200 OK“, even in case of an XML-RPC fault (see below). • The response contains a single value (like a return argument of a local procedure call). HTTP/1.1 200 OK Connection: close Content-Length: 158 Content-Type: text/xml Date: Fri, 17 Jul 1998 19:55:08 GMT Server: UserLand Frontier/5.1.2-WinNT <?xml version="1.0"?> <methodResponse> <params> <param> <value> <string>South Dakota</string> </value> </param> </params> </methodResponse> HTTP header (response) with required header fields (blue) XML body
  • 7. Š Peter R. Egli 2015 7/11 Rev. 1.60 XML-RPC indigoo.com 3. XML-RPC protocol (3/5) Response with a failure (example from www.xmlrpc.com/spec): • Even in case of an XML-RPC level failure the HTTP return code is 200 OK. • The failure is indicated with the <fault> element. HTTP/1.1 200 OK Connection: close Content-Length: 426 Content-Type: text/xml Date: Fri, 17 Jul 1998 19:55:02 GMT Server: UserLand Frontier/5.1.2-WinNT <?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>
  • 8. Š Peter R. Egli 2015 8/11 Rev. 1.60 XML-RPC indigoo.com 3. XML-RPC protocol (4/5) Parameter types (1/2): Base types: XML-RPC has a very limited set of base types: Type Description Example <i4> or <int> Four-byte signed integer -12 <boolean> 0 (false) or 1 (true) 1 <string> ASCII string (string is default) Hi! <double> Double-precision 3.1415 <dateTime.iso8601> Date/time 19980717T14:08:55 <base64> Base64-encoded binary eW91IGNhbid Structs: Structs contain elements (<member>) with a <name> and <value> element ("named" values). Structs may be recursive (value in a struct may be a struct again). <struct> <member> <name>lowerBound</name> <value><i4>18</i4></value> </member> <member> <name>upperBound</name> <value><i4>139</i4></value> </member> </struct>
  • 9. Š Peter R. Egli 2015 9/11 Rev. 1.60 XML-RPC indigoo.com 3. XML-RPC protocol (5/5) Parameter types (2/2): Arrays: An array contains a single <data> element that in turn contains an array of <value> elements. An array differs from a struct in that its elements are simple values (without <name> element). Arrays may be recursive (value in array may be an array or also a struct). <array> <data> <value><i4>12</i4></value> <value><string>Egypt</string></value> <value><boolean>0</boolean></value> <value><i4>-31</i4></value> </data> </array>
  • 10. Š Peter R. Egli 2015 10/11 Rev. 1.60 XML-RPC indigoo.com 4. XML-RPC server implementation in Java The class loader provides lookup service (find the serving class from request name). The XML-RPC listener does unmarshalling / marshalling of parameters. The XML-RPC handler is the user class that handles the request (implementation of the actual procedure call). WebServer XML-RPC listener Classloader properties Load mapping into class loader XML-RPC handler (user class) Defines the mapping from service name to class name serving the requests HTTP protocol front-end Passes the request to the XML-RPC server Consults class loader to get the serving class Unpack the XML, get the serving class, convert the arguments (C  S) Pack the response into XML (S  C) Pass the request to the serving class HTTP
  • 11. Š Peter R. Egli 2015 11/11 Rev. 1.60 XML-RPC indigoo.com 5. Where to use XML-RPC • XML-RPC may be suited for simple applications or situations where clients implemented in different technologies need to interact with a server with simple read-write operations where a more complex middleware technology would be overkill. • XML-RPC is a solution to integrate different platforms with a simple middleware. • XML-RPC is very simple so it can be implemented also for platforms without open source or commercially available XML-RPC libraries. Java PL/1 C++ RMI / IIOP CORBA DCOM CORBA runtime DCOM runtime C++ Integration of different platforms leads to complexity on the server side Java PL/1 C++ XML-RPC runtime C++ XML-RPC as a common integration technology reduces complexity on the server side (but adds complexity on the client side) XML-RPC stub HTTP