Book 2
Book 2
WEB TECHNOLOGY
COURSE MATERIAL
Web Technology
PART 2
The Open University of Sri Lanka (OUSL) is the premier Open and Distance learning institution in the
country where students can pursue their studies through Open and Distance Learning (ODL)
methodologies. Degrees awarded by OUSL are treated as equivalent to the degrees awarded by other
national universities in Sri Lanka by the University Grants Commission of Sri Lanka.
© 2019 by the Commonwealth of Learning and The Open University of Sri Lanka. Except where
otherwise noted, Web Technology is made available under Creative Commons Attribution-
ShareAlike 4.0 International (CC BY-SA 4.0) License: https://creativecommons.org/licenses/by-
sa/4.0/legalcode.
Acknowledgements
Department of Electrical and Computer Engineering (ECE), The Open University of Sri Lanka
(OUSL) wishes to thank those below for their contribution to Part II of this course material:
HUW Ratnayake
Author:
S. Rajasingham Unit 11
Content Editors:
Dilan Perera
HUW Ratnayake
GSN Meedin
Desktop Publishing:
S. Rajasingham
Contents
About this course material 153
How this course material is structured ....................................................................... 153
Unit 11 161
Web Services ............................................................................................................ 161
Introduction ..................................................................................................... 161
11.1 Webservice .............................................................................................. 161
Activity ..................................................................................................................... 162
11.2 SOAP ....................................................................................................... 162
Activity ..................................................................................................................... 164
11.3 RESTful ................................................................................................... 164
11.4 Creating Web services .................................. Error! Bookmark not defined.
Activity ..................................................................................................................... 166
........................................................................................................................ 166
Unit summary ........................................................................................................... 166
References and Further Reading ................................................................................ 167
Acknowledgement .................................................................................................... 167
Unit 12 168
Enterprise Integration ................................................................................................ 168
Introduction ..................................................................................................... 168
12.1 The Enterprise .......................................................................................... 169
12.2 Integration ................................................................................................ 169
12.3 Approaches to Integration ........................................................................ 170
12.4 Integration Styles ..................................................................................... 171
Activity ..................................................................................................................... 174
12.5 Enterprise Integration Patterns.................................................................. 174
Activity ..................................................................................................................... 177
12.6 Messaging Concerns ................................................................................ 177
Activity ..................................................................................................................... 178
Unit summary ........................................................................................................... 178
References and Further Reading ................................................................................ 179
Acknowledgement .................................................................................................... 179
Web Technology
how much time you will need to invest to complete the course
study skills
activity icons
units
153
About this course material
unit outcomes.
new terminology.
a unit summary.
Resources
For those interested in learning more on this subject, we provide you with
a list of additional resources at the end of each unit; these may be books,
articles or web sites.
Your comments
After completing Web Application Development we would appreciate if
you would take a few moments to give us your feedback on any aspect of
this course. Your feedback might include comments on:
course content and structure.
course reading materials and resources.
course assignments.
course assessments.
course duration.
course support (assigned tutors, technical help, etc.)
154
Web Technology
Course overview
Apply scripting languages and web services to transfer data and add
Outcomes interactive components to web pages.
155
Course overview
Timeframe
This is one-academic year course of 150 total learning hours
Self study time is 5 hours per week for a 8-month academic year which
How long? include exams as well.
Study skills
As an adult learner your approach to learning will be different to that
from your school days: you will choose what you want to study, you will
have professional and/or personal motivation for doing so and you will
most likely be fitting your study activities around other professional or
domestic responsibilities.
Your most significant considerations will be time and space i.e. the time
you dedicate to your learning and the environment in which you engage
in that learning.
http://www.how-to-study.com/
The “How to study” web site is dedicated to study skills resources.
http://www.howtostudy.org/resources.php
Another “How to study” web site with useful links to time
management, efficient reading, questioning/listening/observing skills,
getting the most out of doing (“hands-on” learning), memory building,
tips for staying motivated, developing a learning plan.
156
Web Technology
The above links are our suggestions to start you on your way. At the time
of writing these web links were active. If you want to look for more go to
www.google.com and type “self-study basics”, “self-study tips”, “self-
study skills” or similar.
Need help?
This course is offered by the Department of Electrical and Computer
Engineering of The Open University of Sri Lanka for registered students.
If you need help regarding this course and if you are a registered student
Help at OUSL, please contact:
More details will be given with the activity schedule for the particular
year.
Assignments
There will be two assignments for this course which will be changed
every year and will be given in the Learning Management System ( LMS)
157
Assessments
There will be:
4 laboratory sessions,
Assessment
2 TMAs
All continous assesment components will take place before the Final
Exam. You have to obtain more than 40% for Overall CA Mark to sit for
the final exam.
158
Web Technology
Margin icons
While working through this course you will notice the frequent use of
margin icons. These icons serve to “signpost” a particular piece of text, a
new task or change in activity; they have been included to help you to
find your way around this course. We suggest that you familiarize
yourself with the icons and their meaning before starting your study.
Computer-Based
Learning Audio Video Feedback
159
Web Technology
Unit 11
Web Services
Introduction
Now that you have an understanding of what Web Application Security
is. Let‟s look into the web service. This unit describes the importance of
the web services and the common standards it follows. It also goes into
the details of SOAP and gives a brief demonstration of how a simple web
service is created.
161
Unit 11
Activity
Activity 11.1
Web service
Explain the purpose of webservices and state the standards that are used
in developing it.
11.2 SOAP
You have already studied XML and the use of HTTP. Now that we
will discuss the rest of the commonly used standards, let‟s look into
the details of SOAP.
SOAP is a lightweight protocol that was created for transferring
information in a decentralized, distributed environment. The XML
technologies are used to define the extensible messaging
162
Web Technology
163
Unit 11
Activity
Activity 11.2
SOAP
11.3 RESTful
Now you understand SOAP, another important concept to
understand with respect to web services is RESTful.
The Representational State Transfer (REST) style is an abstraction
of the architectural elements within a distributed hypermedia
system. RESTful ignores the details of component implementation
and protocol syntax in order to focus on the roles of components,
the constraints upon their interaction with other components, and
their interpretation of significant data elements. It encompasses the
fundamental constraints upon components, connectors, and data
that define the basis of the Web architecture, and thus the essence
of its behavior as a network-based application. RESTful Web
services allow the requesting systems to access and manipulate
textual representations of Web resources by using a uniform and
predefined set of stateless operations. In a RESTful Web service,
requests made to a resource's URI will elicit a response with a
payload formatted in HTML, XML, JSON, or some other format.
The response can confirm that some alteration has been made to the
stored resource, and the response can provide hypertext links to
other related resources or collections of resources.
The most important concept in RESTful is resources, which are
identified by global IDs typically using URIs. Client applications
use HTTP methods (GET/ POST/ PUT/ DELETE) to manipulate
the resource or collection of resources. A RESTful Web service
implements using HTTP and the principles of RESTful. Typically,
a RESTful Web service should define the following aspects:
The base/root URI for the Web service such as
http://host/<appcontext>/resources.
164
Web Technology
Tomcat Installation
1. Open Window -> Preferences -> Server -> Runtime
Environments to create a Tomcat installed runtime.
2. Click on Add to open the New Server Runtime dialog, then
select your runtime under Apache (Apache 7.0 from the list).
“Create a new local server” must be checked when adding
the Apache Tomcat runtime environment. (This is useful so
not to mess up your actual web services with your web
services that you are developing and testing).
3. Put your Tomcat installation dir e.g. C:\Program
Files\Apache Software Foundation\Tomcat 7.0 and finish.
4. In the Servers view panel, you will see the Tomcat server
Stopped. In the Project Explorer view, a Server
configuration will appear.
5. If you run the Server you might encounter an error if your
Tomcat is already running. So you must configure different
ports for your installation, otherwise you must stop your
Tomcat server while you are developing and testing your
web services. If you double click the server, the local
configuration will appear. Change the ports as you wish and
the Right Click the server Icon and select Start to start the
server.
Now that you have installed and configured Tomcat in your
machine. You can follow the step by step tutorial in the following
165
Unit 11
Activity
Activity 11.3
Unit summary
In this unit, we discussed the use of web service and it also
describes the protocols a web service should follow. It gives a brief
description of the SOAP and details of RESTful services. It also
gives an overview to create a simple web service.
Summary
166
Web Technology
1. https://tomcat.apache.org/tomcat-3.2-doc/tomcat-apache-
howto.html#intro (Apache License:
http://www.apache.org/licenses/LICENSE-2.0)
2. https://www.w3.org/TR/soap12-part1/#soapnodes.
3. http://www.softwareagility.gr/index.php?q=node/29.
Acknowledgement
Some contents for this Unit was taken from the following links:
https://tomcat.apache.org/tomcat-3.2-doc/tomcat-apache-
howto.html#intro (Apache License:
http://www.apache.org/licenses/LICENSE-2.0)
https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_a
rch_style.htm
https://www.restapitutorial.com/lessons/restfulresourcena
ming.html
https://www.w3.org/TR/wsdl/
https://www.crummy.com/writing/RESTful-Web-
Services/ CC BY 4.0))
https://www.hindawi.com/journals/am/2011/238683/
167
Unit 12
Unit 12
Enterprise Integration
Introduction
Software systems range from simple console or desktop
applications which doesn‟t even use file storage or a database to
large scale solutions which deliver content in multiple formats, uses
several means of storing data and can be decomposed into sub-
systems. Such systems are typically not built as a unit, but evolve
over time, typically in response to business needs. Sometimes,
systems evolve separately and are connected at a later point in time,
to provide business functionality that neither could provide in
isolation.
In this session, you will be learning about the context in which such
software is created, the approaches that can be used to connect
systems and recurring techniques for connecting systems which can
be used to good effect when designing software - with the intent
that you make an informed decision about their use for projects.
Upon completion of this unit you will be able to:
168
Web Technology
12.2 Integration
As noted by Woolf and Hohpe [www2] and attested to above,
today‟s applications rarely live in isolation. Integration is the
process by which two (or more) systems are brought out of
169
isolation to interoperate with each other - with the intention of
deriving some synergistic benefit.
170
Web Technology
request to perform the task; System B then performs the task and
connects back to System A, to return the result of the operation.
Using the previous analogy, this approach is analogous to a person
(System A) making a telephone call to another person (System B),
requesting that B should retrieve some information for A. While B
performs this task, A hangs up the phone and performs some other
tasks. Once B has the necessary information, B calls A back (from
which stems the term „callback‟) and provides the information.
This has the advantage of being better from a resource utilization
perspective (i.e. System A can perform other tasks), but it can be
more complex to implement as System B needs to know how to
connect to System A (which does not occur in the synchronous
model).
Since System A is not blocked from performing any other
operations, this is also known as a „non-blocking‟ approach.
171
This style allows each application to function synchronously, but is
best suited for publishing data.
Shared Database
This integration style shares data by all integrating applications (of
varying technologies and platforms) using a common database.
172
Web Technology
173
Message payloads are typically represented using standard data
formats, such as XML or JSON.
This style is inherently asynchronous and supports both publishing
and retrieval of data, although the manner of retrieval is via
callback.
Activity
Activity 12.1
174
Web Technology
Point-to-Point Channel
Point-to-Point Channels are a mechanism of ensuring that exactly
one receiver will receive a specific message.
175
The messaging system will maintain an output channel per
subscription, linked to an input channel. When the input channel
receives a message, it will internally deliver a copy of the message
to the related output channels, thus ensuring that each subscriber
receives the message once. Upon delivery, the message is removed
from the output channel.
Publish-Subscribe channels are typically realized in messaging
systems as topics, where a topic is bound to by subscribers and
written to by publishers. Internally, Message Queues might be used
to handle internal message delivery (between input and output
channels).
Message Bus
This pattern is more advanced and used in response to an enterprise
scenario where several systems need to be able to fulfil business
requests, operating in a unified manner, with the facility to easily
add or remove applications without affecting other applications.
176
Web Technology
Activity
Activity 12.2
177
These delivery semantics influence how applications are designed
to process messages, especially in the face of message delivery
failure. While exactly once is the ideal situation, it is a hard
problem to solve and architects are advised to design systems
taking the above into consideration. Underlying any conversation
on delivery semantics is the need for reliable messaging. This
means messaging systems are typically built atop reliable transport
layer protocols such as TCP/IP.
Message Ordering
In an ideal world, all messages would arrive in the order that they
were dispatched. However, this too is a hard problem to solve and
architects need to take out-of-order delivery into consideration,
when designing applications.
Activity
Activity 12.3
Design an integration solution for the following scenarios, using
Integration Patterns:
1. You are developing a weather forecasting mobile app and a
weather Web Service has been identified.
2. An e-Learning Tool has sent assessment grades to your
RESTful Web Service; there are multiple systems in your
domain that wish to be notified of these grades.
3. Your system posts Customer Profile changes to a
downstream partner system; you know that some messages
may fail (i.e. cannot be delivered).
Unit summary
This unit dealt with approaches taken to connecting systems in the
software industry, with the content describing integration
approaches, styles and patterns that are commonly used. The
session also looked at fundamentals like „what is an enterprise‟ and
178
Web Technology
https://pubs.opengroup.org/architecture/togaf9-
doc/arch/chap03.html#tag_03_38
https://www.enterpriseintegrationpatterns.com/
https://www.confluent.io/blog/exactly-once-semantics-are-
possible-heres-how-apache-kafka-does-it/
https://developer.lightbend.com/blog/2017-11-01-atotm-akka-
messaging-part-2/index.html
Acknowledgement
Some contents for this Unit was taken by:
Images from [www2] used under the Creative Commons Attribution
license. As specified at the end of each pattern page (e.g. File Transfer),
the “pattern icon, the pattern name, the problem and solution statements
(in bold), and the sketch under this license” [www2] are candidates for
re-use, under this license.
179