Vous êtes sur la page 1sur 10

Middleware Technologies Assignment 1:

Q1) Client server concept with example...

1. Client-server is a computing architecture which separates a client from a server, and is almost always
implemented over a computer network.
2. Each client or server connected to a network can also be referred to as a node.
3. The most basic type of client-server architecture employs only two types of nodes: clients and servers.
4. This type of architecture is sometimes referred to as two-tier. It allows devices to share files and resources.
5. Each instance(process) of the client software can send data requests to one or more connected servers. In turn,
the servers can accept these requests, process them, and return the requested information to the client.
6. These days, clients are most often web browsers, although that has not always been the case.
7. Servers typically include file servers, database servers, group servers, object servers, web servers.
8. The interaction between client and server is often described using sequence diagrams.

File servers:

1. In the client/server model, a file server is a computer responsible for the central storage and management of data
files so that other computers on the same network can access the files.
2. A file server allows users to share information over a network without having to physically transfer files by
floppy diskette or some other external storage device.
3. Any computer can be configured to be a host and act as a file server.
4. In its simplest form, a file server may be an ordinary PC that handles requests for files and sends them over the
5. In a more sophisticated network, a file server might be a dedicated network-attached storage (NAS) device that
also serves as a remote hard disk drive for other computers, allowing anyone on the network to store files on it
as if to their own hard drive.

Database servers:
1. Refers to the back-end system of a database application using client/server architecture.
2. The back-end, sometimes called a database server, performs tasks such as data analysis, storage, data
manipulation, archiving, and other non-user specific tasks.

Web severs:
A web server is a computer program that delivers (serves) content, such as web pages, using the Hypertext
Transfer Protocol (HTTP), over the World Wide Web.
1. The primary function of a web server is to deliver web pages to clients. This means delivery of HTML
documents and any additional content that may be included by a document, such as images, style sheets
2. A client, commonly a web browser, initiates communication by making a request for a specific resource using
HTTP and the server responds with the content of that resource, or an error message if unable to do so.
3. The resource is typically a real file on the server's secondary memory, but this is not necessarily the case and
depends on how the web server is implemented.
4. While the primary function is to serve content, a full implementation of HTTP also includes a way of receiving
content from clients.
5. This feature is used for submitting web forms, including uploading of files.
6. Web servers are not always used for serving the world wide web, rather they can also be found embedded in
devices such as printers, routers, webcams serving only a local network.
7. The web server may then be used as a part of a system for monitoring and/or administrating the device in

Q2) What are the characteristics of a client/server system?

The basic characteristics of client/server architectures are:

1. combination of a client or front-end portion that interacts with the user, and a server or back-end portion that
interacts with the shared resource.
2. The client process contains solution-specific logic and provides the interface between the user and the rest of the
application system.
3. The server process acts as a software engine that manages shared resources such as databases, printers, modems,
or high powered processors.
4. The front-end task and back-end task have fundamentally different requirements for computing resources such as
processor speeds, memory, disk speeds and capacities, and input/output devices.
5. The environment is typically heterogeneous and multivendor.
6. The hardware platform and operating system of client and server are not usually the same.
7. Client and server processes communicate through a well-defined set of standard application programing interfaces
(API's) and RPC's.
8. An important characteristic of client-server systems is scalability. They can be scaled horizontally or vertically.
9. Horizontal scaling means adding or removing client workstations with only a slight performance impact.
10. Vertical scaling means migrating to a larger and faster server machine or multiservers.

Q3) explain with example the term middleware. explain general middleware and service specific
The software layer that lies between the operating system and applications on each side of a distributed computing
system in a network. Middleware is a computer software that connects software components or applications. The
software consists of a set of services that allows multiple processes running on one or more machines to interact.
This technology evolved to provide for interoperability in support of the move to coherent distributed architectures,
which are most often used to support and simplify complex, distributed applications. It includes web servers,
application servers, and similar tools that support application development and delivery. Middleware is especially
integral to modern information technology based on XML, SOAP, Web services, and service-oriented architecture.

For example, some middleware is used to link a database system to a Web server, allowing users to access the
database via a Web browser.

• Middleware does not include the software that provides the actual service that’s in the server’s domain.
• It also does not include the user interface or the application’s logic that’s in the client’s domain.
• It starts with the API set on the client side that is used to invoke a service, and it covers the transmission of the
request over the network and the resulting response.
• Middleware divided into two broad classes:
• (a) General Middleware (b) Service-Specific Middleware (study from others also)

(a) General Middleware

• It is the substrate for most client/server interactions
• It includes the communication stacks, distributed directories, authentication stacks, distributed directories,
authentication services, network time, remote procedure calls, and queuing services.
• Products that fall into the general middleware category include DCE, ONC+, NetWare, NamedPipes, LAN Server,
LAN Manager, Vines, TCP/IP, APPC and NetBIOS.
• Message Oriented Middleware (MOM) products from Peerlogic, Covia, Message Express, System Strategies and
• It depends on message queue system and increases portability, interoperability, flexibility.

(b) Service-Specific Middleware

• It is need to accomplish a particular client/server type of service.
• This includes
○ Database-specific middleware such as ODBC, DRDA, EDA/SQL, SAG/CLI and Oracle Glue.
○ OLTP-specific middleware such as Tuxedo’s ATMI and /WS, Encina’s Transactional RPC, and X/Open’s TxRPC
○ Groupware-specific middleware such as MAPI, VIM, VIC, SMTP and Lotus Notes Calls
○ Object-specific middleware such as OMG’s CORBA and Microsoft’s Network OLE (or DCOM)
○ Internet-specific middleware such as HTTP, S-HTTP and SSL
○ System Management-specific middleware such as SNMP, CMIP and ORBs.

Q4) explain client-server building blocks in detail.

The Client Building Block

• Runs the client side of the application
• It runs on the OS that provides a GUI and that can access distributed services, wherever they may be.
• The client also runs a component of the Distributed System Management (DSM) element.

The Server Building Block

• Runs the server side of the application
• The server application typically runs on top of some shrink-wrapped server software package.
• The five contending server platforms for creating the next generation of client/server applications are SQL database
severs, TP Monitors, groupware servers, Object servers and the Web server.
• The server side depends on the OS to interface with the middleware building block.
• The server also runs DSM component
• It may be a simple agent or a shared object database etc.

The Middleware Building Block

• Runs on both the client and server sides of an application
• This broken into three category
○ Transport Stacks
○ Service-specific middleware
• Middleware is the nervous system of the client/server infrastructure
• This also has the DSM component

• Runs on every node in the client/server network.
• A managing workstation collects information from all its agents on the network and displays it graphically.
• The managing workstation can also instruct its agents to perform actions on its behalf.

Q5) explain RPC, Messaging, peer-to-peer concepts. Compare MOM and RPC architecture.

Remote Procedure Call (RPC): One of the earliest facilities that were created to help programmers write
client/server software is known generically as a Remote Procedure Call mechanism. When implementing a
program, the programmer uses procedures to keep the code manageable. Instead of defining a single, large
procedure that performs many tasks, the programmer divides the tasks into sets and uses shorter procedure to
handle each set. A client procedure process calls a function on a remote server and suspends itself until it gets back
the result. This process that issues the calls and waits until it gets the result is called remote procedure call.

``Peer-to-Peer'' refers to a class of systems and applications that employ distributed resources (i.e., computing
power, networking resources) to perform a task (i.e., content delivery, collaboration, e-commerce) in a
decentralized manner on general-purpose operating systems and platforms.

Feature MOM RPC

Metaphor Post-office like Telephone like

Client/Server time Asynchronous. Clients and Servers may Synchronous. Clients and Servers must
relationship operate at different times and speeds run concurrently. Servers must keep up
with clients.

Client/Server No fixed sequence Servers must first come up before clients

Sequencing can talk to them.

Style Queued Call-Return

Partners need to be No Yes


Load-balancing Single queue can be used to implement Requires a separate TP Monitor.

FIFO or priority based policy

Transactional Yes (Some Products) Message Queue No. Requires a Transactional RPC.
Support can participate in the commit

Message Filtering Yes No

Performance Slow. An intermediate hop is required Fast

Asynchronous Yes. Queues and triggers are required Limited. Requires threads and tricky code
processing for managing threads.

6) Explain web services in detail with an example.

Web services is an extension of ActiveX. There are shortcomings of ASP compared to JSP. JSP has been enriched
with the concepts of Beans and Tags. ASP equivalent for Beans and Tags was ActiveX Controls and ActiveX
automation servers. However, whatever ActiveX automation server function is called, the function MUST
physically reside on the same machine. For example an ActiveX automation server must be implemented either as a
.dll or as an .exe and then must also be registered in Windows Registry before an asp code can call its functions. It
is obvious that these days it is a strong limitation. Microsoft's answer to this problem is "Web Services".

“A Web service is a software system designed to support interoperable machine-to-machine

interaction over a network. It has an interface described in a machine-process able format.”

The process goes something like this :

1. The Web service provider develops a useful function(s), and publish/advertise it. The Web Service provider
uses Web Service Description Language (WSDL)standard to describe the interface of the function(s)
2. The programmer/client who needs the function does a lookup by using a process called - Web Service
Discovery or SOAP Discovery
3. The Actual communication between the client program and the web service takes place through a protocol
called Simple Object Access Protocol (SOAP)

Web Service Example

Imports System
Imports System.Web.Services
Imports Microsoft.VisualBasic
Public Class HelloWorld : Inherits WebService
Public Function <WebMethod()> GreetTheUser(strUserName as String) as String
Select Case strUserName
Case "Kashif Manzoor"
return "Hello Author"
Case "Amna Kashif"
return "Hello Ms. Amna Kashif"
Case "Ahmed Luqman"
return "Hello little Ahmed"
Case Else
return "Hello Stranger"
End Select
End Function
End Class
The Function is declared with the key word <WebMethod()> this indicates that this function can be invoked from
the web across the Internet. A simple web service has been made.

7) explain SOA with an example.

Service Oriented Architecture is a paradigm for organizing and utilizing distributed capabilities that may be under
the control of different ownership domains. It provides a uniform means to offer, discover, interact with and use
capabilities to produce desired effects consistent with measurable preconditions and expectations.

A deployed SOA-based architecture will provide a loosely-integrated suite of services that can be used within
multiple business domains.
SOA defines how to integrate widely disparate applications for a world that is Web based and uses multiple
implementation platforms. Rather than defining an API, SOA defines the interface in terms of protocols and
functionality. An endpoint is the entry point for such an SOA implementation.

Service-orientation requires loose coupling of services with operating systems, and other technologies that underlie
applications. SOA separates functions into distinct units, or services, which developers make accessible over a
network in order to allow users to combine and reuse them in the production of applications. These services and
their corresponding consumers communicate with each other by passing data in a well-defined, shared format, or by
coordinating an activity between two or more services.

• Service loose coupling – Services maintain a relationship that minimizes dependencies and only requires that they
maintain an awareness of each other.
• Service Abstraction – Beyond descriptions in the service contract, services hide logic from the outside world.
• Service Reusability – Logic is divided into services with the intention of promoting reuse.
• Service Autonomy – Services have control over the logic they encapsulate.
• Service Statelessness - Services minimize resource consumption by deferring the management of state information
when necessary.
• Service Discoverability – Services are supplemented with communicative meta data by which they can be
effectively discovered and interpreted.
• Service Composability – Services are effective composition participants,regardless of the size and complexity of
the composition.

Example: AirNet Systems

AirNet provides air transportation services for small package shippers and banking customers, and is the leading
transporter of canceled checks and related information in the U.S.
problem they faced:
the technologies that powered AirNet's business had been developed and maintained department by department. IT
staff had built individual silos of data and software for each task, often duplicating work from one project to the
next. This made their applications costly to maintain and even costlier to modify, and limited the company's

How they implemented their SOA:

One of the early decisions that AirNet made was to choose an integrated platform as the foundation of the new IT
infrastructure. This meant that whatever effort they put into building new functionality or applications was
inherently service oriented.
The first application AirNet built was a Web-based rate engine for their call center, using rules-based intelligence to
calculate price quotes based on shipment origin, destination, size and weight. When a call center agent or a
customer requests a quote, the application accesses the appropriate data from back-end systems and delivers it via
the Web. This rate engine was built in seven months by a team of only two developers, an extremely aggressive
rollout schedule for an application of such strategic importance.
The developers - who had limited Web services experience - were able to become productive in just a couple of
weeks using a SOA approach instead of traditional development methodologies.

8) explain SOAP process in detail with neat diagram.

SOAP is an XML based protocol intended for exchanging structured information in a distributed application
SOAP is actually a communication protocol that defines how a message should be constructed, transmitted from
one node to another, and processed by each node as shown in the following diagram:
SOAP node
| Construct an initial SOAP message
| Bind the initial message for transmission
| Transmit the initial message
----------> SOAP node
| Receive the initial message
| Process some part of the initial message
| Reconstruct an intermediate SOAP message
| Bind the intermediate message for transmission
| Transmit the intermediate message
----------> SOAP node
| ...
----------> SOAP node
| Receive the final message
| Process the final message
SOAP message format:
A SOAP message contains 3 parts:
1. Envelope
2. Header
3. Body

Defines an overall framework for expressing what is in a message and who should deal with it.
The Envelope element is always the root element of a SOAP message. The Envelope element contains an optional
Header element followed by a mandatory Body element.

 Is an optional component
 The Header has information about how the message is to be processed

 Contains the message referred to as “payload”
 Must be a child of the Envelope element

 SOAP is an XML-based messaging framework that is

1) extensible: SOAP defines a communication framework that allows for features such as security,
routing, and reliability to be added later
2) interoperable : SOAP can be used over any transport protocol such as TCP, HTTP, SMTP

3) independent : SOAP allows for any programming model and is not tied to RPC

SOAP also allows for any number of message exchange patterns (MEPs).

9) Explain WSDL with an example.

Web Services Description Language is an XML-based language used to define Web services and describe how to
access them. WSDL is used to describe the Web service, specify its location, and describe the operations (i.e. methods).

Once you develop a Web Service you publish its description and a link to it in a UDDI repository so that potential
users can find it When someone wants to use your service, they request the WSDL file in order to find out the location
of the service, the function calls and how to access them Then they use this information in your WSDL file to form a
SOAP request to the computer.

A client can invoke a web service using SOAP, HTTP GET/POST and MIME.

WSDL Document Structure:

<definition> - Root element

<types> - Provides data type definitions

<message> - Represents the abstract definition of the data

being transmitted

<portType> - Defines a set of abstract operations

<binding> - Specifies concrete protocol and data format

specifications for the operations and messages defined by a

particular portType

<port> - Specifies an address for a binding

<service> - Used to aggregate a set of related ports.

10) What do you mean by REST service. Explain with an example.

Make do with class notes .

11) What is java servlet technology? Explain its advantages.

The Problems with Applets and CGI

Java Applets have three major drawbacks:

1. Take time to load onto client May not work as planned (depends on JVM)
2. Security risk for client
3. Server-side code is preferred for business logic

CGI allows an application to run on server but creates server performance problems. Most notably each time a
separate process must be spawned (for Java a separate JVM is run). Servlets overcome this problem

 Servlets rely on a Servlet Engine (Application Server) to manage multiple requests for the same application
 Java servlets have the advantages of Java applets but run on the server side

 The Jserv engine from SUN was the first Applications run on the server.

Extend functionality of a web server and provide structure for a business environment. Servlets can be operating
system and hardware platform independent. Servlets process HTTP/HTML requests with all the benefits of the mature
Java language (portability, performance, reusability, and crash protection.)