SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
© 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

Contenu connexe

Tendances (20)

Java J2EE
Java J2EEJava J2EE
Java J2EE
 
Php array
Php arrayPhp array
Php array
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
RichControl in Asp.net
RichControl in Asp.netRichControl in Asp.net
RichControl in Asp.net
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
 
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) ModelingEnhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
 
Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3Enterprise java unit-1_chapter-3
Enterprise java unit-1_chapter-3
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Oracle Index
Oracle IndexOracle Index
Oracle Index
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Model View Controller (MVC)
Model View Controller (MVC)Model View Controller (MVC)
Model View Controller (MVC)
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 
Object Oriented Relationships
Object Oriented RelationshipsObject Oriented Relationships
Object Oriented Relationships
 
Json
JsonJson
Json
 
Java access modifiers
Java access modifiersJava access modifiers
Java access modifiers
 
Collections In Java
Collections In JavaCollections In Java
Collections In Java
 
Introduction to java
Introduction to  javaIntroduction to  java
Introduction to java
 

En vedette

Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTPradeep Kumar
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
Mule ESB
Mule ESBMule ESB
Mule ESBniravn
 
Matrimonial web site Documentation
Matrimonial web site DocumentationMatrimonial web site Documentation
Matrimonial web site Documentationhome
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentationguest0df6b0
 

En vedette (6)

Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
SOAP vs REST
SOAP vs RESTSOAP vs REST
SOAP vs REST
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
Mule ESB
Mule ESBMule ESB
Mule ESB
 
Matrimonial web site Documentation
Matrimonial web site DocumentationMatrimonial web site Documentation
Matrimonial web site Documentation
 
Web Service Presentation
Web Service PresentationWeb Service Presentation
Web Service Presentation
 

Similaire à XML-RPC (XML Remote Procedure Call)

Boost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSBoost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSInformation Development World
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol BuffersMatt O'Keefe
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckEdward Burns
 
Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14Ajith Narayanan
 
Bt0083 server side programing 2
Bt0083 server side programing  2Bt0083 server side programing  2
Bt0083 server side programing 2Techglyphs
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web servicesnbuddharaju
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Build a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded SystemBuild a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded SystemJian-Hong Pan
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthroughmitesh_sharma
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
 
Micro HTTP Server for Embedded
Micro HTTP Server for EmbeddedMicro HTTP Server for Embedded
Micro HTTP Server for Embeddedexeri0n1
 

Similaire à XML-RPC (XML Remote Procedure Call) (20)

xml rpc
xml rpcxml rpc
xml rpc
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
Boost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BSBoost Your Content Strategy for REST APIs with Gururaj BS
Boost Your Content Strategy for REST APIs with Gururaj BS
 
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful  Protocol BuffersJavaOne 2009 - TS-5276 - RESTful  Protocol Buffers
JavaOne 2009 - TS-5276 - RESTful Protocol Buffers
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
 
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute InfodeckServlet 4.0 Adopt-a-JSR 10 Minute Infodeck
Servlet 4.0 Adopt-a-JSR 10 Minute Infodeck
 
Tibco business works
Tibco business worksTibco business works
Tibco business works
 
Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14Best practices for large oracle apps r12 implementations apps14
Best practices for large oracle apps r12 implementations apps14
 
HTTP Basic
HTTP BasicHTTP Basic
HTTP Basic
 
Bt0083 server side programing 2
Bt0083 server side programing  2Bt0083 server side programing  2
Bt0083 server side programing 2
 
Lambdas and Laughs
Lambdas and LaughsLambdas and Laughs
Lambdas and Laughs
 
Servlet 3.0
Servlet 3.0Servlet 3.0
Servlet 3.0
 
Overview of RESTful web services
Overview of RESTful web servicesOverview of RESTful web services
Overview of RESTful web services
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Network basics
Network basicsNetwork basics
Network basics
 
JAX-RS.next
JAX-RS.nextJAX-RS.next
JAX-RS.next
 
Build a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded SystemBuild a Micro HTTP Server for Embedded System
Build a Micro HTTP Server for Embedded System
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
Micro HTTP Server for Embedded
Micro HTTP Server for EmbeddedMicro HTTP Server for Embedded
Micro HTTP Server for Embedded
 

Plus de Peter R. Egli

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosPeter R. Egli
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking ConceptsPeter R. Egli
 
Communication middleware
Communication middlewareCommunication middleware
Communication middlewarePeter R. Egli
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Peter R. Egli
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Peter R. Egli
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET PlatformPeter R. Egli
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud ComputingPeter R. Egli
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingPeter R. Egli
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development KitPeter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Peter R. Egli
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBAPeter R. Egli
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Peter R. Egli
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging ServicePeter R. Egli
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 

Plus de Peter R. Egli (20)

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking Concepts
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET Platform
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Web services
Web servicesWeb services
Web services
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 

Dernier

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

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