0% found this document useful (0 votes)
6 views25 pages

Week8_F22_WebServices_SOA

WebServices_SOA

Uploaded by

a.hamoud6161
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views25 pages

Week8_F22_WebServices_SOA

WebServices_SOA

Uploaded by

a.hamoud6161
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Service Oriented Architecture

& Web services


Service-oriented Architecture

◼ A service is some functionality that is exposed for use by


other processes.
◼ Such exposure is achieved through some interface that
can be used by any service requestor.
◼ A web service is functionality that is exposed and would
be accessed through web technologies.
◼ Service-oriented architecture examines how to build, use,
and combine services.
◼ Instead of creating a large software suite that does
everything, we can build and use services, and design an
architecture that supports using such services.
◼ Note: Such definitions are retrieved from UoFA course on service-oriented
architecture from Coursera.
2
Service-oriented Architecture

◼ How could the situation be prior to web


services?

3
Service-oriented Architecture

◼ Instead, a web service defines such communication


through a set of communication protocols and standard
data formats.
◼ Hence, a web application for travelling (e.g., travgo) may
take information from services that obtain flight prices,
services that obtain hotel prices, car rental services.
◼ However, some non-functional requirements become
very important, like:
◼ Response time
◼ Availability

4
Roles of SOA Building Blocks

by Dirk Krafzig, Karl Banke, and Dirk Slama


5
5
SOAP versus REST Example

◼ To better grasp the practical differences between


SOAP and REST, we have created an example of
how the same operation could be performed
using the two technologies.
◼ In the example, we are making a request for user
details.
◼ Example retrieved from:
https://www.upwork.com/resources/soap-vs-
rest-a-look-at-two-different-api-styles#soap-
vs-rest
6
SOAP Example

◼ Using SOAP, the request to the API is an HTTP


POST request with an XML request body.
◼ In this case, we want to fetch the user with the
name “John.”

7
SOAP Example

◼ The request body consists of an envelope which is


a type of SOAP wrapper that identifies the
requested API, and a SOAP body that holds the
request parameters.

8
SOAP Example

◼ The response, just like the request, consists of a


SOAP envelope and a SOAP body. In this case, the
SOAP body represents the requested user data.

9
REST Example

◼ REST APIs can be called with all of the HTTP verbs.


◼ To get a resource, in this case, a user, a GET
request is used.
◼ While the SOAP request holds the user’s name in
the body, a REST API accepts GET parameters
from the URI.
◼ GET https://restexample.com/users?name=John

10
WEB SERVICE EXAMPLE

11
Copyright © 2011 Soha Makady. All rights reserved 12

These slides are taken from CPSC 310 2015 course offering at UBC
12
Copyright © 2011 Soha Makady. All rights reserved 13

These slides are taken from CPSC 310 2015 course offering at UBC
13
Web Service Example: Waldo

◼ Consider an Android application called Waldo.


◼ The Waldo application lets you:
◼ (1) track other users of the Waldo application
within a certain geographic area
◼ (2) plots your location and the locations of other
users on a map
◼ (3) uses live bus information from Translink to
determine the best bus to use to reach a selected
user's location from your current location.
Copyright © 2011 Soha Makady. All rights reserved 14

These slides are taken from CPSC 210 2013 course offering at UBC
14
Web Service Example

These slides are


taken from
CPSC 410 2016
course offering
at UBC

Copyright © 2011 Soha Makady. All rights reserved 15

15
Waldo Web Service

◼ The Waldo web service will let you query to:


◼ find Waldos to plot on your map and for which you
can search for routes to, and
◼ receive messages sent to you from Waldos

Copyright © 2011 Soha Makady. All rights reserved 16

These slides are taken from CPSC 210 2013 course offering at UBC
16
Waldo Web Service

◼ The waldo service is a web-service that is


deployed on server. It:
◼ tracks the names of users, or waldos, who are
using the service
◼ allows waldos to notify the service of their current
location
◼ permits waldos to retrieve the locations of other
waldos
◼ permits waldos to exchange messages in a limited
fashion 17

These slides are taken from CPSC 210 2013 course offering at UBC
17
Waldo Web Service Architecture

18

These slides are taken from CPSC 210 2013 course offering at UBC
18
What API is provided by Waldo Service?

◼ Waldo service API


◼ 1 initSession
◼ 2 getWaldos
◼ 3 getWaldoByName
◼ 4 postLocation
◼ 5 sendMsg
◼ 6 getMsgs
◼ 7 Error codes
◼ 8 Notes 19

These slides are taken from CPSC 210 2013 course offering at UBC
19
What API is provided by Waldo Service?

◼ Waldo service API


◼ getWaldos
◼ Description:
◼ Retrieve the location records for num number of
waldos who have most recently updated their
locations.
◼ Signature:
◼ {ErrorNumber,ErrorString} | [{Name,Loc}, ... ,
{Name,Loc}] =
Copyright © 2011 Soha Makady. All rights reserved
getWaldos(key, num)
20


These slides are taken from CPSC 210 2013 course offering at UBC
20
What API is provided by Waldo Service?

◼ Waldo service API


◼ getWaldos
◼ Example URL:
http://kramer.nss.cs.ubc.ca:8080/getwaldos/CW
ejewid/5
key = "CWejewid"
num = 5
Copyright © 2011 Soha Makady. All rights reserved 21

These slides are taken from CPSC 210 2013 course offering at UBC
21
What API is provided by Waldo Service?

◼ Waldo service API


◼ getWaldos
◼ Example successful return value:
[{"Name":"StationaryEchoBot",
"Loc":{"Lat":49.26612,
"Long":-123.24703,
"Tstamp":1383530259}}
….]
Copyright © 2011 Soha Makady. All rights reserved 22

These slides are taken from CPSC 210 2013 course offering at UBC
22
Copyright © 2011 Soha Makady. All rights reserved 23

These slides are taken from CPSC 410 2016 course offering at UBC
23
Required Reading

◼ Chapter 5, from Ian Gorton’s: Essential


Software Architecture, Springer Verlag
Second Edition, 2011.

24
References

◼ Distributed Systems: Concepts and Design, 5th edition.


Coulouris, et. Al
◼ http://en.wikipedia.org/wiki/Service-oriented_architecture
◼ http://en.wikipedia.org/wiki/Web_service
◼ Software Engineering (9th Edition), Ian Sommerville
◼ Cook, William R., and Janel Barfield. "Web services
versus distributed objects: A case study of performance
and interface design." Web Services, 2006. ICWS'06.
International Conference on. IEEE, 2006.
RESTful versus SOAP example:
https://www.upwork.com/resources/soap-vs-rest-a-look-at-
two-different-api-styles#soap-vs-rest

25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy