Download presentation
Presentation is loading. Please wait.
1
Web Services
2
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 can be encoded in the operation signature in the server’s “interface” or RPC Payload semantics: It can be embedded in the message itself 11/8/2018
3
Interface Semantics Process1 Process2 getCustomer() retrieveCustomerData() returnResult() Semantics of the activity is explicitly stated in the message/method call 11/8/2018
4
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 11/8/2018
5
Payload Semantics onMessage() 11/8/2018
6
Payload semantics is generic
String transferMoney (amt: decimal, accTo: String) { …} String executeService (message: String) 11/8/2018
7
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). 11/8/2018 CSE507 Introduction 2008
8
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. 11/8/2018 CSE507 Introduction 2008
9
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. 11/8/2018 CSE507 Introduction 2008
10
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). 11/8/2018 CSE507 Introduction 2008
11
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 "> <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> 11/8/2018 CSE507 Introduction 2008
12
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) 11/8/2018 CSE507 Introduction 2008
13
SOAP Request <soap:Envelope xmlns:soap=" <soap:Body> <getProductDetails xmlns=" <productId>827635</productId> </getProductDetails> </soap:Body> </soap:Envelope> 11/8/2018 CSE507 Introduction 2008
14
SOAP Reply <soap:Envelope xmlns:soap=" <soap:Body> <getProductDetailsResponse xmlns=" <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> 11/8/2018 CSE507 Introduction 2008
15
SOAPWeb Services (WS)SOA
Read this paper: 11/8/2018 CSE507 Introduction 2008
16
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) 11/8/2018
17
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 11/8/2018
18
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.