Lecture 15: Frameworks for Application-layer Communications

Similar documents
Lecture 15: Frameworks for Application-layer Communications

JAVA RMI. Remote Method Invocation

Göttingen, Introduction to Web Services

RPC flow. 4.3 Remote procedure calls IDL. RPC components. Procedure. Program. sum (j,k) int j,k; {return j+k;} i = sum (3,7); Local procedure call

Introduction to Web Services & SOA

Introduction to Web Services & SOA

Distributed Systems COMP 212. Lecture 10 Othon Michail

Simple Object Access Protocol (SOAP) Reference: 1. Web Services, Gustavo Alonso et. al., Springer

Web services are a middleware, like CORBA and RMI. What makes web services unique is that the language being used is XML

A short introduction to Web Services

Verteilte Systeme (Distributed Systems)

Sistemi ICT per il Business Networking

CSci Introduction to Distributed Systems. Communication: RPC In Practice

Remote Method Invocation

Outline. EEC-681/781 Distributed Computing Systems. The OSI Network Architecture. Inter-Process Communications (IPC) Lecture 4

Introduzione ai Web Services

Remote Method Invocation

5.4. Events and notifications

XML Extensible Markup Language

CmpE 596: Service-Oriented Computing

Remote Method Invocation Java RMI & Web-Services

Desarrollo de Aplicaciones en Red RMI. Introduction. Considerations. Considerations. RMI architecture

Semantic Web. Semantic Web Services. Morteza Amini. Sharif University of Technology Fall 94-95

Object Interaction. Object Interaction. Introduction. Object Interaction vs. RPCs (2)

Web Services: Introduction and overview. Outline

03 Remote invocation. Request-reply RPC. Coulouris 5 Birrel_Nelson_84.pdf RMI

Introduction to Web Services

Web Services. GC: Web Services-I Rajeev Wankar

XML Web Service? A programmable component Provides a particular function for an application Can be published, located, and invoked across the Web

CHAPTER 2 LITERATURE SURVEY 2. FIRST LOOK ON WEB SERVICES Web Services

Introduction and Overview Socket Programming Lower-level stuff Higher-level interfaces Security. Network Programming. Samuli Sorvakko/Nixu Oy

1.264 Lecture 16. Legacy Middleware

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Remote Invocation Vladimir Vlassov and Johan Montelius

XML. Jonathan Geisler. April 18, 2008

Module 12 Web Service Model

Written by: Dave Matuszek

(9A05803) WEB SERVICES (ELECTIVE - III)

CS 5523 Operating Systems: Remote Objects and RMI

Remote Method Invocation R.M.I.

Chapter 9 Web Services

DS 2009: middleware. David Evans

RMI. Remote Method Invocation. 16-Dec-16

UNITE 2003 Technology Conference

Remote Objects and RMI

Distribution and web services

Distributed Programming with RMI. Overview CORBA DCOM. Prepared By: Shiba R. Tamrakar

Remote Procedure Call

Distributed Systems. 5. Remote Method Invocation

SOAP Specification. 3 major parts. SOAP envelope specification. Data encoding rules. RPC conventions

Semantic Web. Semantic Web Services. Morteza Amini. Sharif University of Technology Spring 90-91

Berner Fachhochschule. Technik und Informatik. Web Services. An Introduction. Prof. Dr. Eric Dubuis Berner Fachhochschule Biel

RPC. Remote Procedure Calls. Robert Grimm New York University

RMI. (Remote Method Invocation)

Web services. Patryk Czarnik. XML and Applications 2016/2017 Lecture

Programming with RMI Reminder

Introduction to XML. XML: basic elements

Concurrent Object-Oriented Programming

Analysis and Selection of Web Service Technologies

JAC444 - Lecture 11. Remote Method Invocation Segment 2 - Develop RMI Application. Jordan Anastasiade Java Programming Language Course

RMI (Remote Method Invocation) Over the year, there have been 3 different approaches to application development:

Programming Web Services in Java

DISTRIBUTED COMPUTING

The UNIVERSITY of EDINBURGH. SCHOOL of INFORMATICS. CS4/MSc. Distributed Systems. Björn Franke. Room 2414

Distributed Objects and Remote Invocation. Programming Models for Distributed Applications

Contents. Java RMI. Java RMI. Java RMI system elements. Example application processes/machines Client machine Process/Application A

Web Applications. Web Services problems solved. Web services problems solved. Web services - definition. W3C web services standard

Remote Method Invocation Benoît Garbinato

Introduction and Overview Socket Programming Higher-level interfaces Final thoughts. Network Programming. Samuli Sorvakko/Nixu Oy

Modeling Systems and Optimization Services

Grid Computing. Java Remote Method Invocation (RMI) RMI Application. Grid Computing Fall 2006 Paul A. Farrell 9/5/2006

Web services (GSE NL)

BEAAquaLogic. Service Bus. Interoperability With EJB Transport

presentation DAD Distributed Applications Development Cristian Toma

Distributed Objects. Object-Oriented Application Development

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

Web-services. Brian Nielsen

ID2208 Programming Web Services

SOAP. Gustavo Alonso Computer Science Department Swiss Federal Institute of Technology (ETHZ)

Remote Method Invocation. Benoît Garbinato

Remote Method Invocation

IBD Intergiciels et Bases de Données

The XML Metalanguage

15-498: Distributed Systems Project #1: Design and Implementation of a RMI Facility for Java

Web Services Overview

KINGS COLLEGE OF ENGINEERING 1

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

UNITE 2006 Technology Conference

COP 4814 Florida International University Kip Irvine. Inside WCF. Updated: 11/21/2013

SOAP. Jasmien De Ridder and Tania Van Denhouwe

Remote Method Invocation in Java

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY. (An NBA Accredited Programme) ACADEMIC YEAR / EVEN SEMESTER

SUN. Java Platform Enterprise Edition 6 Web Services Developer Certified Professional

Chapter 8 Web Services Objectives

1. Introduction and Concepts

Introduction to Web Services

presentation DAD Distributed Applications Development Cristian Toma

Web Services Chapter 9 of Coulouris

SOAP Introduction Tutorial

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Transcription:

Lecture 15: Frameworks for Application-layer Communications Prof. Shervin Shirmohammadi SITE, University of Ottawa Fall 2005 CEG 4183 15-1

Background We have seen previously that: Applications need to exchange messages In the labs, the assignments, and the project, we used application-level framing that uses application-specific tokens. Whiteboard example Fall 2005 CEG 4183 15-2

Motivation Token-based messaging scheme can become complicated as the application adds more and more features. Think of the number of commands in a word-processor applications. There should be a way for a more methodical and structured technique to allow programs to communicate. Ideally, the programmer should not even have to worry about communication and how it s done. Enter communications frameworks: RPC, RMI, CORBA, SOAP Fall 2005 CEG 4183 15-3

Remote Procedure Call RPC, used in C and C++ (theoretically language neutral) The idea goes back to 1976, with full-scale implementations appearing in the late 1970s. We know that in a program, functions can call one another. Even different programs running on the same computer can call each other s function. e.g., OLE on Windows, pipes on UNIX, The idea behind RPC is to allow the same thing for programs running on different computers. A program on my computer should be able to call a function inside a program on your computer. Fall 2005 CEG 4183 15-4

RPC Host 1 Host 2 main.c void main() { compute(3, 5); int compute() { return x+y/x; compute.c int compute() { return x+y/x; compute.c Somehow we have to transmit the return value (which can be anything: integer, array, linked list, ) over the network. What else must we take care of? Fall 2005 CEG 4183 15-5

RPC Details During compilation, client and server stubs are created. Application calls a function from the client stub, which converts arguments to Network Data Representation (NDR) and sends them to the RPC run-time. Run-time uses the transport layer to send data to server. Server s RPC run-time takes the incoming data and passes them to server s stub, which runs the actual procedure. Result is returned similarly. Fall 2005 CEG 4183 15-6

Remote Method Invocation RMI, used in Java only. Can be thought of as Object-oriented RPC. Host 1 Host 2 main.java void main() { Local.compute(3, 5); int compute() { return x+y/x; int compute() { return x+y/x; Remote.compute(3,5); Local.java Remote.java How to send objects over the network? Fall 2005 CEG 4183 15-7

RMI Details Stub (remote object) and skeleton (server object) is created. Stubs don t need to be compiled into the client, they can be downloaded at run-time. Remote objects are registered, and clients can download their stub to use their services. Application invokes remote object s stub as if invoking a local object. Stub passes the arguments to Remote Reference Layer which then uses the transport layer for network communication. RRL at server invokes the skeleton, which invokes the actual object to do the operation. The result is sent back in a similar manner. Fall 2005 CEG 4183 15-8

RMI Example Time server example in RMI First, we define the service available by describing its methods. No implementation is needed at this stage users don t care anyway about the internal implementation, they just want to be able to call the function. Defining the interface: TimeInterface.java: import java.rmi.*; public interface TimeInterface extends Remote { public String gettime() throws RemoteException; Fall 2005 CEG 4183 15-9

RMI Example: Remote Object Now we need to implement that Interface Time.java: import java.rmi.*; import java.rmi.server.*; public class Time extends UnicastRemoteObject implements TimeInterface { public String gettime() throws RemoteException { return "It's 12PM"; Fall 2005 CEG 4183 15-10

We need to run the service: Server.java: import java.rmi.naming; public Server { RMI Example: Server public static void main (String[] argv) { try { Naming.rebind ("Time", new Time()); System.out.println ("Time Server is running."); catch (Exception e) { System.out.println ("Problem with Time Server: " + e); Fall 2005 CEG 4183 15-11

RMI Example: Client Finally, we can write a client program that uses the Time service: Client.java: import java.rmi.naming; public Client { public static void main (String[] argv) { try { TimeInterfacce time_object = (TimeInterface) Naming.lookup ("137.122.20.16/Time"); System.out.println (time_object.gettime()); catch (Exception e) { System.out.println ("Exception: " + e); Fall 2005 CEG 4183 15-12

CORBA Common Object Request Broker Architecture, an Object Management Group (OMG) standard Cross-platform, language-independent! Provides services to enable an application in a given programming language to talk to a remote application using another programming language, both running on different platforms. Includes many services for registry, lookup, naming, and so on. Uses Interface Definition Language (IDL) to specify method signatures (return type, name, arguments). IDL is platform-independent, and defines its own types. Stub (client) and skeleton (server) is created during compilation. These have to be implemented in a language-specific manner. Binding is done during run-time. Fall 2005 CEG 4183 15-13

CORBA Scenario Host 1 Win 95 Host 2 Solaris void main() { compute(3, 5); main.c int compute() { return x+y/x; Remote.java Fall 2005 CEG 4183 15-14

SOAP Simple Object Access Protocol, a W3C standard, is a communications protocol to exchange messages among applications. Typically used on top of HTTP. Doesn t have to be HTTP. An XML-based application-layer communications technique. The idea is, similar to RPC RMI and CORBA, to hide the communication part and let the application-layer on one side to talk to the application layer on the other side. Part of the Web Services paradigm. What is a Web Service? A Web page that provides a a service? Fall 2005 CEG 4183 15-15

IBM Evolution of Networked Applications Fall 2005 CEG 4183 15-16

Web Evolution XML XML HTML HTML TCP/IP TCP/IP Technology Technology Connectivity Presentation Programmability FTP, E-mail, Gopher Innovation Innovation Web Pages mail, Gopher Web Pages Web Services Services Browse the Web Program the Web Fall 2005 CEG 4183 15-17

Web Services are: a solution for providing application-to-application communication over the Internet. a URL-addressable software resource that performs functions. Web services communicate using standard protocol known as SOAP (Simple Object Access Protocol) A Web services is located by its listing in a Universal Discovery, Description and Integration (UDDI) directory. A Web Service is typically defined using the Web Service Definition Language (WSDL) Requester Broker Provider Service Requester Discover / describe WSDL UDDI Service Broker Publish / describe WSDL UDDI Service Provider Bind SOAP Fall 2005 CEG 4183 15-18 XML

Architecture Request & Response Service Tier SOAP or XML-RPC HTTP SOAP or XML-RPC HTTP Listener Web Services API CORBA, RMI, DCOM, JMS middleware Business Services SOAP and XML-RPC have become accepted standards for XML-based messaging. HTTP is the protocol for the Internet. The Web Service will parse the request and either fulfill the request directly, or invoke one or more business services via some middleware API. Fall 2005 CEG 4183 15-19

Extensible Markup Language (XML) XML is a metadata language: data that describes data. It is used as a standard way for information exchange. W3C standard In some ways it can be thought as part of the presentation layer. It is a subset of SGML (Standard Generalized Markup Language) SGML is the parent of HTML The key to success of XML: it lets you define your own data types in a standard way. Processing XML: APIs (DOM, SAX) addressing XML: XPath, XLink, XPointer Fall 2005 CEG 4183 15-20

XML Element and Attributes Element <resource> <tutorial name= cooking"> <authors> <author>jane Smith</author> </authors> <title>the Joy of Cooking</title> </tutorial> Attribute </resource> Nice, but how do we know what are resource, tutorial, title,? Fall 2005 CEG 4183 15-21

Document Type Definitions (DTD) recursive types <!ELEMENT A (B C)> <!ELEMENT B (A C)> "an A can contain a B..." "... which contains an A!" <!ELEMENT C (#PCDATA)> loose typing <!ELEMENT A ANY> no context-sensitive types: DTDs cannot distinguish between the publisher in <journal> <publisher>... </publisher> </journal> <website> <publisher>... </publisher> </website> What do to in terms of conflicts such as this? Fall 2005 CEG 4183 15-22

XML Namespaces My element may not be your element: geometry context: <element>line</element> chemistry context: <element>oxygen</element> use XML namespaces to identify the vocabulary <?xml version="1.0" encoding="utf-8"?> <lists xmlns= http://deltabis.com/products xmlns:it="http://deltabis.com/itinerary"> <product sku="8822n" size="small" type="trouser"> <it:itinerary> <it:sold>120</it:sold>... Fall 2005 CEG 4183 15-23

Example <?xml version="1.0" encoding="utf-8"?> <lists xmlns= http://deltabis.com/products xmlns:it="http://deltabis.com/itinerary"> <product sku="8822n" size="small" type="trouser"> <it:itinerary> <it:sold>120</it:sold> <it:onhold>45</it:onhold> <it:returned>10</it:returned> </it:itinerary> </product> <product sku="9820y" size="small" type="tshirt"> <it:itinerary> <it:sold>283</it:sold> <it:onhold>232</it:onhold> <it:returned>23</it:returned> </it:itinerary> </product> </lists> Fall 2005 CEG 4183 15-24

WSDL Web Services Definition Language Standard for defining a Web Service Defines an abstract interface and bindings to particular message formats Defines how to locate the service (URLs for HTTP) Defines what protocol the service uses (HTTP, SMTP, FTP) Written in XML Used to publish services in UDDI Fall 2005 CEG 4183 15-25

UDDI Universal Discovery, Description and Integration Standard for publishing Web Services Directory service that enables clients to locate services Services can be found by searching or unique ID Servers provide a SOAP based interface (API) for finding and publishing Three roles for UDDI data White pages technical contact information and addresses Yellow pages various services available from business Green pages technical information about services including WSDL SOAP processor UDDI registry service Client application SOAP request SOAP response Web server UDDI database UDDI registry node Fall 2005 CEG 4183 15-26

Back to Web Services: SOAP SOAP provides transfer of structured data between services. SOAP is an XML based transport protocol. Protocol binding: HTTP, SMTP One way message: Sender or Receiver It is stateless, and therefore the sender and receiver need not maintain a session to communicate. The application however has to take care of the communications semantics. Fall 2005 CEG 4183 15-27

SOAP Details With SOAP, we re actually back to a concept which is similar to the familiar token-based message passing, but SOAP is standardized. Host 1 Host 2 void main() { getlowestprice(); main.c Give me lowest price for book lowest price is $67.99 Web service provider Fall 2005 CEG 4183 15-28

SOAP Request getlowestprice <?xml version="1.0"?> <soap:envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingstyle="http://www.w3.org/2001/12/soap-encoding"> <soap:body> <m:getprice mlns:m="http://www.w3schools.com/prices"> <m:item>isbn78932167</m:item> </m:getprice> </soap:body> </soap:envelope> This message is sent to the server using HTTP. Fall 2005 CEG 4183 15-29

SOAP Response Response: <?xml version="1.0"?> <soap:envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingstyle="http://www.w3.org/2001/12/soap-encoding"> <soap:body> <m:getprice mlns:m="http://www.w3schools.com/prices"> <m:price>67.99</m:price> </m:getprice> </soap:body> </soap:envelope> This message is returned to the requester. Fall 2005 CEG 4183 15-30