Web Services and Application Development using Services API

Slides:



Advertisements
Similar presentations
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
Advertisements

31242/32549 Advanced Internet Programming Advanced Java Programming
Web Services Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
SOAP.
1 Understanding Web Services Presented By: Woodas Lai.
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
G O B E Y O N D C O N V E N T I O N WORF: Developing DB2 UDB based Web Services on a Websphere Application Server Kris Van Thillo, ABIS Training & Consulting.
Presentation 7 part 2: SOAP & WSDL. Ingeniørhøjskolen i Århus Slide 2 Outline Building blocks in Web Services SOA SOAP WSDL (UDDI)
A New Computing Paradigm. Overview of Web Services Over 66 percent of respondents to a 2001 InfoWorld magazine poll agreed that "Web services are likely.
Aligning Business Processes to SOA B. Ramamurthy 6/16/2015Page 1.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
B. RAMAMURTHY Web services. Topics What is a web service? From OO to WS WS and the cloud WS code.
Web Service What exactly are Web Services? To put it quite simply, they are yet another distributed computing technology (like CORBA, RMI, EJB, etc.).
CS 415 N-Tier Application Development By Umair Ashraf July 6,2013 National University of Computer and Emerging Sciences Lecture # 9 Introduction to Web.
Web Services Michael Smith Alex Feldman. What is a Web Service? A Web service is a message-oriented software system designed to support inter-operable.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Web Services Description Language (WSDL) Jason Glenn CDA 5937 Process Coordination in Service and Computational Grids September 30, 2002.
XML and Web Services (II/2546)
Kemal Baykal Rasim Ismayilov
Service Oriented Architecture + SOAP -Robin John.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Services Martin Nečaský, Ph.D. Faculty of Mathematics and Physics Charles University in Prague, Czech Republic Summer 2014.
Web Technologies Lecture 10 Web services. From W3C – A software system designed to support interoperable machine-to-machine interaction over a network.
1/30/20161 Introduction to Web Services Bina Ramamurthy
INFSO-RI Enabling Grids for E-sciencE Web Services Mike Mineter National e-Science Centre, Edinburgh.
Software Architecture Patterns (3) Service Oriented & Web Oriented Architecture source: microsoft.
A service Oriented Architecture & Web Service Technology.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 9 Web Services: JAX-RPC,
Added Value to XForms by Web Services Supporting XML Protocols Elina Vartiainen Timo-Pekka Viljamaa T Research Seminar on Digital Media Autumn.
12. DISTRIBUTED WEB-BASED SYSTEMS Nov SUSMITHA KOTA KRANTHI KOYA LIANG YI.
Service Oriented Architecture (SOA) Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Java Web Services Orca Knowledge Center – Web Service key concepts.
Introduction to Web Services
Cloud Computing Web Services.
Sabri Kızanlık Ural Emekçi
WEB SERVICES From Chapter 19 of Distributed Systems Concepts and Design,4th Edition, By G. Coulouris, J. Dollimore and T. Kindberg Published by Addison.
A Web Services Journey on the .NET Bus
WEB SERVICES.
T Network Application Frameworks and XML Web Services and WSDL Sasu Tarkoma Based on slides by Pekka Nikander.
Introduction to Web Services
Unit – 5 JAVA Web Services
Distributed web based systems
Web Services CO5027.
Web Services.
Introduction to Web Services and SOA
Inventory of Distributed Computing Concepts and Web services
Service-centric Software Engineering
Inventory of Distributed Computing Concepts
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Defining Data-intensive computing
Inventory of Distributed Computing Concepts
CSSSPEC6 SOFTWARE DEVELOPMENT WITH QUALITY ASSURANCE
Introduction to Web Services
Introduction to Web Services
Service Oriented Architecture + SOAP
Inter-process Communication Models
Distributed Systems through Web Services
Creating a Distributed System with Remote Procedure Calls and Web Services Ch.5 B.Ramamurthy 2/17/2019 B.Ramamurthy.
WebServices Using JAX-RPC
Introduction to Web Services
Introduction to Service-Oriented Architectures (SOA)
Distributed System using Web Services
Introduction to Web Services
Introduction to SOA and Web Services
WEB SERVICES From Chapter 19, Distributed Systems
Introduction to Web Services and SOA
Distributed System using Web Services
Inventory of Distributed Computing Concepts
Presentation transcript:

Web Services and Application Development using Services API B. Ramamurthy

Interface vs Payload Semantics Typically interaction between a client and a server results in the execution of an activity (or transaction) Activity needs to be specified by the request. Interface semantics: Requested activity is encoded in an operation signature in the server’s “interface”: RPC (remote procedure call) (think about procedure call or function invocation) Semantics of the activity is explicit in the message/call Payload semantics: It (activity) is embedded in a message 2/27/2019

Interface Semantics Process1 Process2 getCustomer() retrieveCustomerData() returnResult() Semantics of the activity is explicitly stated in the message/method call 2/27/2019

Payload Semantics Process 1 Process 2 Envelop With message Process 1 Process 2 Requested transaction/activity is embedded in the message Details of the activity not explicit; the semantics are embedded in the message 2/27/2019

Payload Semantics onMessage() 2/27/2019

Payload semantics is generic String transferMoney (amt: decimal, accTo: String) { …} Vs. String executeService (message: String) --message contains “transferMoney”, amt, acctTo etc. 2/27/2019

XML XML is a markup language, developed by W3C (World Wide Web Consortium), mainly to overcome the limitations of HTML. But it took a life of its own and has become a very popular part of distributed systems. We will examine its definition, associated specifications (DTD, XSLT etc.), Java APIs available to process XML, protocols and services based on XML, and the role XML plays in a distributed computing environment. 2/27/2019 CSE507 Introduction 2008

First Look at XML It has no predefined tags. It is stricter. Such as in HTML Domains may specify their own set of standard tags It is stricter. Most html document have errors and the browser have to built to take care of these. On the other hand XML has a strict syntax. There is a notion of validity and A notion of well-formed. 2/27/2019 CSE507 Introduction 2008

An Example: Memo See the two documents enclosed: one in html and the other in XML formats. Observe the meaningful tags in XML. Compare it to a class definition: it looks like a class with data definitions and accessors (tags). 2/27/2019 CSE507 Introduction 2008

Memo.html vs memo.xml <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <title>memo.html</title> </head> <body> <h3>Hello World</h3> Bina<br> CSE4/587SOA Students <br> Wake up everyone<br> BR<br> <br> </body> </html> <?xml version="1.0" ?>   <!DOCTYPE memo (View Source for full doctype...)> - <memo>   <header>Hello World</header>   <from>bina</from>   <to>CSE4/587 Students</to>   <body>Wake up everyone</body>   <sign>br</sign>   </memo> 2/27/2019 CSE507 Introduction 2008

XML to SOAP Simple xml can facilitate sending message to receive information. The message could be operations to be performed on objects. Simple Object Access Protocol (SOAP) 2/27/2019 CSE507 Introduction 2008

SOAP Request <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetails xmlns="http://warehouse.example.com/ws"> <productId>827635</productId> </getProductDetails> </soap:Body> </soap:Envelope> 2/27/2019 CSE507 Introduction 2008

SOAP Reply <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <getProductDetailsResponse xmlns="http://warehouse.example.com/ws"> <getProductDetailsResult> <productName>Toptimate 3-Piece Set</productName> <productId>827635</productId> <description>3-Piece luggage set. Black Polyester.</description> <price>96.50</price> <inStock>true</inStock> </getProductDetailsResult> </getProductDetailsResponse> </soap:Body> </soap:Envelope> 2/27/2019 CSE507 Introduction 2008

SOAPWeb Services (WS)SOA Read this paper: http://www.w3.org/DesignIssues/WebServices.html 2/27/2019 CSE507 Introduction 2008

Document-centric Messages With emergence of self-descriptive data structures such as XML, document-centric has become popular Semantically rich messages where operation name, its parameters, return type are self descriptive. SOAP (Simple Object Access Protocol) over XML is an example Loose coupling of systems (vs. Java RMI like RPC that are tightly coupled) 2/27/2019

Tight vs. Loose coupling Level Tight coupling Loose coupling Physical coupling Direct physical link required Physical intermediary Communication style synchronous asynchronous Type system Strongly typed (interface semantics) Weak type system (payload semantics) Interaction pattern OO-style navigation of complex object trees Data-centric, self-contained messages Control of process logic Central control of process logic Distributed logic components Service discovery and binding Statically bound services Dynamically bound services Platform dependencies Strong OS and programming language dependencies OS- and programming language dependent 2/27/2019

Lets focus on Web services What is a web service? From OO to WS WS and the cloud WS code

Web Services and SOA Web Services is a technology that allows for applications to communicate with each other in a standard format. A Web Service exposes an interface that can be accessed through XML messaging. A Web service uses XML based protocol to describe an operation or the data exchange with another web service. Ex: SOAP A group of web services collaborating accomplish the tasks of an application. The architecture of such an application is called Service-Oriented Architecture (SOA). 2/27/2019 CSE507 Introduction 2008

Evolution of the service concept A service is a meaningful activity that a computer program performs on request of another computer program. Technical definition: A service a remotely accessible, self-contained application module. From IBM, Service Component Object/ Class 2/27/2019 BR

Class, Component and Service Class is a core concept is object-oriented architectures. An object is instantiated form a class. Focus on client side, single address space programs. Then came the component/container concept to improve scalability and deployability. Ex: EJBs. Focus on server side business objects and separation of resources from code. Service came into use when publishing, discoverability, on-demand operation among interacting enterprise became necessity. Focus of enterprise level activities, contracts, negotiations, reservations, audits, etc. BR 2/27/2019

Object-oriented programming Encapsulation of data and function in a class, instances of a class is called an object Objects communicate through messages (invoking methods) Class represents a type from which another type can be derived resulting inheritance hierarchy. Problem: level of abstraction and granularity exposed is fine to enable reuse. Data and functions are tightly coupled. The concept of interface Service-orientation assumes that data and functionality are separated. BR 2/27/2019

Web Services and the Cloud Web Service is a technology that allows for applications to communicate with each other in a standard format. A Web Service exposes an interface that can be accessed through XML messaging. A Web service uses XML based protocol to describe an operation or the data exchange with another web service. Ex: SOAP A group of web services collaborating accomplish the tasks of an application. The architecture of such an application is called Service-Oriented Architecture (SOA). Web service is an important enabling technology of cloud computing: software-as-a-service (SaaS), platform-as-a-service(PaaS), infrastructure-as-a-service (IaaS) 2/27/2019

WS Interoperability Infrastructure Service Description WSDL XML Messaging SOAP/ REST Network HTTP Do you see any platform or language dependencies here? 2/27/2019

SOAPWeb Services (WS) Lets look at some WScode: 2/27/2019

Building your own application 2/27/2019 Determine your functionality: UML model use case diagram is a very nice tool to use at this stage Determine the source of your internal and external data Examine the data and its utilization in the application Methods for enhancing the application Web data Crawling and screen scraping RSS feeds (Aaron Swartz.. Go read about him) RESTful services Web services

Acquiring the DATA 2/27/2019 Example: Get the houses available from Craigslist and post it on Google maps Enabling technologies for acquiring data: Crawler: spiders, start with a URL and visit the links in the URL collecting data, depth of crawling is parameter Screen scrappers: extract information that is contained in html pages. Biological sciences: High throughput sequencers Web services: APIs that facilitate the communication between applications. Organizations make available the relevant information as services REST and SOAP are two underlying pipes for WS

Functionality 2/27/2019 Use case diagram is a good tool to discover/define the functionality of your applications Questions to ask: What are the main functions? What kind of data? Structured? Unstructured? Where will be stored? Will it be shared? What are the sources of data? Does it deal with geographic locations (maps)? Does it share content? Does it have search? Any automatic decisions to be made based on rules? What is the security model?

REST SOAP is a heavy weight protocol Representation State Transfer (REST) Ph.D. thesis by Roy Fielding, who was the Was chairman of the Apache Software Foundation (not anymore) REST uses simple HTML operations GET, PUT, POST, DELETE for carrying out web operations/activity It is an architectural style not a protocol REST has become the favored style for web services to communicate REST-based APIs provides by many applications

REST simplicity SOAP: <?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 pb="http://www.acme.com/phonebook"> <pb:GetUserDetails> <pb:UserID>12345</pb:UserID> </pb:GetUserDetails> </soap:Body> </soap:Envelope> Vs REST http://www.acme.com/phonebook/UserDetails/12345 It uses GET, POST etc of HTTP protocol

What else is there? Most Google services API are REST based: Google search REST API, Google translate API, Google Big Query API etc. Netflix REST API Facebook announced it is going to promote Graph API as the means of getting data out its services… These APIs are the means by which you create an integrated application that makes use of the services offered by others into your application Bottom line is we need well understood (and standard) mechanism for invoking (web) services, extracting and adding data