XML-RPC The Quickest Way to Web Services. THE MOVES INSTITUTE XML-RPC XML-RPC is an attempt to implement conventional Remote Procedure Call (RPC) concepts.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

Introduction to Java 2 Programming Lecture 10 API Review; Where Next.
WEB SERVICES. FIRST AND FOREMOST - LINKS Tomcat AXIS2 -
Introduction to Maven 2.0 An open source build tool for Enterprise Java projects Mahen Goonewardene.
SOAP.
RPC Robert Grimm New York University Remote Procedure Calls.
SE 370: Programming Web Services Week 4: SOAP & NetBeans Copyright © Steven W. Johnson February 1, 2013.
A1.1 Assignment 1 “Deploying a Simple Web Service”
Tam Vu Remote Procedure Call CISC 879 – Spring 03 Tam Vu March 06, 03.
XML-RPC Remote Procedure Call (RPC) is a model that specifies how cooperating processes on different nodes in a heterogeneous computing environment can.
My First Building Block Presented By Tracy Engwirda 28 September, 2005.
J.Sant Servlets Joseph Sant Sheridan Institute of Technology.
EGEE is a project funded by the European Union under contract IST Technologies for Building Grids 15 th October
MC365 Application Servers: Servlets. Today We Will Cover: What a servlet is The HTTPServlet and some of its more important methods How to configure the.
Object-Oriented Enterprise Application Development Tomcat 3.2 Configuration Last Updated: 03/30/2001.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
1 Running Web Applications with Tomcat CS , Winter 2007/8.
SOAP Chandra Dutt Yarlagadda Introduction  Why ?  What ?  How ?  Security Issues in SOAP  Advantages  Uses  Conclusion.
Apache Tomcat Representation and Management of Data on the Web.
Tomcat Configuration A Very, Very, Very Brief Overview.
Web programming for project students Dr Jim Briggs.
Creating a.war file W(eb) AR(chive). Creating a.war file The following article may contain actual software programs in source code form. This source code.
Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Web Applications Basics. Introduction to Web Web features Clent/Server HTTP HyperText Markup Language URL addresses Web server - a computer program that.
Java Servlets and JSP.
Introduction to Java web programming Dr Jim Briggs JWP intro1.
TP2653 Adv Web Programming SOAP and WSDL. SOAP Simple Object Access Protocol – Lightweight XML-based messaging protocol – A protocol for accessing a Web.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Avro Apache Course: Distributed class Student ID: AM Name: Azzaya Galbazar
SSC2: Web Services. Web Services Web Services offer interoperability using the web Web Services provide information on the operations they can perform.
1 EIE424 Distributed Systems and Networking Programming –Part II 2. XML-RPC.
JavaScript, Fourth Edition Chapter 12 Updating Web Pages with AJAX.
Java Servlets CS-422. Application Mapping Your servlet application will be mapped to a directory structure: –“myapp” maps to some directory C:/docs/apps/myapp.
CS441 CURRENT TOPICS IN PROGRAMMING LANGUAGES LECTURE 5_1 George Koutsogiannakis/ Summer
AN OVERVIEW OF SERVLET TECHNOLOGY SERVER SETUP AND CONFIGURATION WEB APPLICATION STRUCTURE BASIC SERVLET EXAMPLE Java Servlets - Compiled By Nitin Pai.
Guidelines for Homework 6. Getting Started Homework 6 requires that you complete Homework 5. –All of HW5 must run on the GridFarm. –HW6 may run elsewhere.
JSP Most of the web developers deploying web applications using servlets mixes the presentation logic and business logic. Separation of business logic.
1 HKU CSIS DB Seminar: HKU CSIS DB Seminar: Web Services Oriented Data Processing and Integration Speaker: Eric Lo.
Remote Procedure Calls Babak Esfandiari. RPC Introduced by Birrell & Nelson (1984) Remote Procedure Calls allow a program to make use of procedures executing.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
Current Trends in Network- Based Application Developments Bill Chu Department of Software and Information Systems UNC Charlotte.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
C HAPTER 11 D EPLOYING YOUR WEB APP. WAR FILE A WAR file is simply a snapshot of your web app structure, in a nice portable, compressed form (it is really.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
S O A P ‘the protocol formerly known as Simple Object Access Protocol’ Team Pluto Bonnie, Brandon, George, Hojun.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
Field Trip #24 Setting Up a Web Server. Apache Apache is one of the most successful open source web servers In 1995 the most popular web server was the.
EGEE is a project funded by the European Union under contract IST SOAP Simple Object Access Protocol 3 – 4 June
1 G52IWS: Example Web-services Chris Greenhalgh. 2 Contents Software requirements AXIS web service run-time components Getting started with Jetty & AXIS.
HTTP protocol Java Servlets. HTTP protocol Web system communicates with end-user via HTTP protocol HTTP protocol methods: GET, POST, HEAD, PUT, OPTIONS,
Netprog: Soap & XML-RPC1 XML-RPC and SOAP. Netprog: Soap & XML-RPC2 XML Extensible Markup Language Markup Language. –HTML is also a markup language (but.
CSE 4939 Alex Riordan Brian Pruitt-Goddard. Design an interactive source control application that works between an android phone and a project located.
JAVA, JEE Training Introduction to Web Harinath Mallepally
The Java API for XML-Based Web Services. A Web Service example in Java SOAP-awareServlet (e.g. Apache Axis2) SOAP-awareServlet Any class processing the.
1 Web Programming with Servlets & JSPs WEB APPLICATIONS – AN OVERVIEW.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Intro to REST Joe Gregorio Google. REST is an Architectural Style.
Web Services in WebLogic Server
Checking the Server.
Chapter 5 Remote Procedure Call
Google Web Toolkit Tutorial
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Checking the Server.
XML-RPC a lightweight data communication protocol
CIS Distributed and Parallel Architectures
Introduction to JBoss application server
Java Servlets and JSP.
Presentation transcript:

XML-RPC The Quickest Way to Web Services

THE MOVES INSTITUTE XML-RPC XML-RPC is an attempt to implement conventional Remote Procedure Call (RPC) concepts using XML to transmit the RPC information Traffic on wire in XML format

THE MOVES INSTITUTE XML-RPC You are specifying that a particular object method be called on a remote host with the arguments passed in, and a given return type. There may be several types of method calls: blocking, non-blocking, fire-and- forget, etc.

THE MOVES INSTITUTE Implementations There are several implementations out there (Userland, Sun, Apache). Some implementations have extensions that make your life easier, but are non-standard. for the apache implementation; I used 3.x You’ll also need commons codec jar file in the classpath if building from scratch See Example.tar.gz for a pre-packaged example Example.tar.gz

THE MOVES INSTITUTE Example POST /RPC2 HTTP/1.0 User-Agent: Frontier/5.1.2 (WinNT) Host: betty.userland.com Content-Type: text/xml Content-length: 181 Calculator.add 41 17

THE MOVES INSTITUTE Apache XML-RPC On the client side the code is relatively straightforward: XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); XmlRpcClient client = new XmlRpcClient(); Object[] params = new Object[]{new Integer(1), new Integer(2)}; System.out.println("preparing execute"); Integer result = (Integer) client.execute("Calculator.add", params);

THE MOVES INSTITUTE Server Side The server side is trickier. There should be java object receiving messages, but how to do this? The apache implementation uses a properties file and a default implementation of a class called XmlRpcServlet to do this XmlRpcServlet handles decoding the XML and encoding the response back

THE MOVES INSTITUTE XmlRpcServlet XML Java Object Some Method Response XML Response XMLRpcServlet is responsible for handling the conversion from and to XML, and calling the Java object that actually implements the functionality

THE MOVES INSTITUTE XmlRpcServlet XmlRpcServlet accepts the HTTP, extracts the XML, and converts the XML into what is necessary to call the method on the local object. It accepts the return value from the object, converts it into XML-RPC, and places it into an HTTP response You don’t have to write any of this code

THE MOVES INSTITUTE XmlRpcServlet To specify the object, you need to modify the xmlrpc- server-3.0.jar file. Extract the contents of the jar file in a temporary directory: jar -xvf xmlrpc-server-3.0.jar Add a file called XmlRpcServlet.properties in org/apache/xmlrpc/webserver Contents are “objectName=fullyQualifiedClassName” Repackage the jar file: “jar -cvf xmlrpc-server-3.0.jar org” Replace the old jar file with the new one

THE MOVES INSTITUTE Set up servlet Deploying the servlet is a little tricky. The environment in which a servlet program lives is standardized AppName WEB-INF web.xml (config file) classes (your classes) lib (supporting jar files)

THE MOVES INSTITUTE Web.xml Contained inside of WEB-INF, describes the servlets, security, etc. The example web.xml file works. It includes a subclass of XmlRpcServlet that adds logging capability The ugly config stuff is done for you if you just use the example distribution

THE MOVES INSTITUTE Example The example distribution includes an Ant file that Generates a xmlRpcExample.war file in the dist directory Runs a client that connects to the servlet To deploy the servlet, remove the old copy from the Tomcat webapps directory, copy dist/xmlRpcExmaple.war it to the Tomcat /webapps directory, and restart Tomcat The war file will be automatically unpacked and the servlet started

THE MOVES INSTITUTE Data Types You can pass Integer, Boolean, String, Double, Date, byte[], Map and Arrays of these With enabledForExtensions switched on, you can pas Byte, Float, Long, XML DOM Node, Short, Serializable, BigDecimal, BigInteger, and Calendar objects

THE MOVES INSTITUTE Modifying To modify the example to do what you want: Unpack the xmlrpc-server-3.0.jar file Modify XmlRpcServlet.properties file with object name on the LHS and fully qualified class name on the RHS Repackage the jar file and replace the old jar file Implement the class with a no-args constructor and public methods that take only legal data types ant dist, copy war file to tomcat webapps directory, stop and restart tomcat