You are on page 1of 6

Q# 1: What are the different Web Services?

Also explain the following terms


regarding the web services in detail.
Web service is a standardized medium to propagate communication between the client and
server applications on the World Wide Web.

A web service is a software module which is designed to perform a certain set of tasks.

 The web services can be searched for over the network and can also be invoked
accordingly.
 When invoked the web service would be able to provide functionality to the client
which invokes that web service.

The diagram shows a very simplistic view of how a web


service would actually work. The client would invoke a series
of web service calls via requests to a server which would host
the actual web service. The diagram shows a very simplistic
view of how a web service would actually work. The client
would invoke a series of web service calls via requests to a
server which would host the actual web service.

These requests are made through what is known as remote procedure calls. Remote Procedure
Calls (RPC) are calls made to methods which are hosted by the relevant web service.

The main component of a web service is the data which is transferred between the client and
the server, and that is XML. XML (Extensible markup language) is a counterpart to HTML
and easy to understand the intermediate language that is understood by many programming
languages.

Web services use something known as SOAP (Simple Object Access Protocol) for sending
the XML data between applications. The data is sent over normal HTTP. The data which is
sent from the web service to the application is called a SOAP message. The SOAP message is
nothing but an XML document. Since the document is written in XML, the client application
calling the web service can be written in any programming language.

A) Types of Web Services?


There are mainly two types of web services.

1. SOAP web services.


2. RESTful web services.

In order for a web service to be fully functional, there are certain components that need to be
in place. These components need to be present irrespective of whatever development
language is used for programming the web service.

1) SOAP (Simple Object Access Protocol):


SOAP is known as a transport-independent messaging protocol. SOAP is based on
transferring XML data as SOAP Messages. Each message has something which is known as
an XML document. Only the structure of the XML document follows a specific pattern, but
not the content. The best part of Web services and SOAP is that it’s all sent via HTTP, which
is the standard web protocol.

Each SOAP document needs to have a root element known as


the <Envelope> element. The root element is the first element
in an XML document.
The "envelope" is in turn divided into 2 parts. The first is the
header, and the next is the body.
The header contains the routing data which is basically the
information which tells the XML document to which client it needs to be sent to.
The body will contain the actual message.

2) WSDL (Web services description language):

A web service cannot be used if it cannot be found. The client invoking the web service
should know where the web service actually resides.

Secondly, the client application needs to know what the web service actually does, so that it
can invoke the right web service. This is done with the help of the WSDL, known as the Web
services description language. The WSDL file is again an XML-based file which basically
tells the client application what the web service does. By using the WSDL document, the
client application would be able to understand where the web service is located and how it
can be utilized.

B) Behavioral characteristics?
XML-Based: Web services use XML at data representation and data transportation layers. Using
XML eliminates any networking, operating system, or platform binding. Web services-based
applications are highly interoperable at their core level.

Loosely Coupled: A consumer of a web service is not tied to that web service directly. The web
service interface can change over time without compromising the client's ability to interact with the
service. A tightly coupled system implies that the client and server logic are closely tied to one
another, implying that if one interface changes, the other must be updated. Adopting a loosely
coupled architecture tends to make software systems more manageable and allows simpler
integration between different systems.

Coarse-Grained: Building a Java program from scratch requires the creation of several
fine-grained methods that are then composed into a coarse-grained service that is consumed
by either a client or another service.
Businesses and the interfaces that they expose should be coarse-grained. Web services
technology provides a natural way of defining coarse-grained services that access the right
amount of business logic.

Ability to be Synchronous or Asynchronous: Synchronicity refers to the binding


of the client to the execution of the service. In synchronous invocations, the client blocks and
waits for the service to complete its operation before continuing. Asynchronous operations
allow a client to invoke a service and then execute other functions.

Asynchronous clients retrieve their result at a later point in time, while synchronous clients
receive their result when the service has completed. Asynchronous capability is a key factor
in enabling loosely coupled systems.

Supports Remote Procedure Calls (RPCs): Web services allow clients to invoke
procedures, functions, and methods on remote objects using an XML-based protocol. Remote
procedures expose input and output parameters that a web service must support.

Component development through Enterprise JavaBeans (EJBs) and .NET Components has
increasingly become a part of architectures and enterprise deployments over the past couple
of years. Both technologies are distributed and accessible through a variety of RPC
mechanisms.

A web service supports RPC by providing services of its own, equivalent to those of a
traditional component, or by translating incoming invocations into an invocation of an EJB or
a .NET component.

Supports document Exchange: One of the key advantages of XML is its generic way
of representing not only data, but also complex documents. These documents can be as
simple as representing a current address, or they can be as complex as representing an entire
book or Request for Quotation (RFQ). Web services support the transparent exchange of
documents to facilitate business integration.

C) Web Service Architecture?


There are two ways to view the web service architecture

1) The first is to examine the individual roles of each web service actor.

2) The second is to examine the emerging web service protocol stack

Web Service Roles: There are three major roles within the web service architecture
Service Provider: This is the provider of the web service. The service provider implements
the service and makes it available on the Internet.

Service Requestor: This is any consumer of the web service. The requestor utilizes an
existing web service by opening a network connection and sending an XML request.

Service Registry: This is a logically centralized directory of services. The registry provides a
central place where developers can publish new services or find existing ones. It therefore
serves as a centralized clearing house for companies and their services.

Web Service Protocol Stack:

A second option for viewing the web service architecture is to examine the emerging web
service protocol stack. The stack is still evolving, but currently has four main layers.

Service Transport: This layer is responsible for transporting messages between applications.
Currently, this layer includes Hyper Text Transport Protocol (HTTP), Simple Mail Transfer
Protocol (SMTP), File Transfer Protocol (FTP), and newer protocols such as Blocks
Extensible Exchange Protocol (BEEP).

XML Messaging: This layer is responsible for encoding messages in a common XML
format so that messages can be understood at either end. Currently, this layer includes XML-
RPC and SOAP.

Service Description: This layer is responsible for describing the public interface to a specific
web service. Currently, service description is handled via the Web Service Description
Language (WSDL).

Service Discovery: This layer is responsible for centralizing services into a common registry
and providing easy publish/find functionality. Currently, service discovery is handled via
Universal Description, Discovery, and Integration (UDDI).

As web services evolve, additional layers may be added and additional technologies may be
added to each layer.
D) Give a real-life Example regarding how to use web services?

The examples below are representative of a number of companies that applied a


variety of tools and equipment from various vendors to dramatically improve their bottom
line. The common element used by all, however, was that the projects were based on
emerging Web Services standards (conformance to XML, SOAP specifications at a minimum).

1. Travelers Insurance Company


Industry: Property & Casualty Insurance
Application: Auto glass claim processing
Result: Cut claim processing by 30%

2. Marks & Spencer


Industry: Retail merchandise
Application: Fraud detection
Result: Lowered development costs by 66%; 415%-1st year ROI

3. Ingram Micro
Industry: Technology products wholesale distribution
Application: eCommerce/B2B integration with product retailer
Result: Lowered development time by 45%

4. Concord EFS, Inc.


Industry: Electronic payment processing
Application: Web payment services (EFSnet)
Result: In first 6 months, number of participating merchants grew at 30% per month and
transaction volume grew by 78% per month.

Q#2. Write down the basic principles of website design.


1) Load Time: Everybody hates a website that takes ages to load.  Tips to make page load times
more effective include optimizing image sizes (size and scale), combining code into a central CSS or
JavaScript file (this reduces HTTP requests) and minify HTML, CSS, JavaScript (compressed to speed
up their load time).

2) Navigation: Navigation is about how easy it is for people to take action and move around
your website. Some tactics for effective navigation include a logical page hierarchy, using bread
crumbs, designing clickable buttons, and following the ‘three clicks rule’ which means users will be
able to find the information they are looking for within three clicks.

3) Mobile friendly: It is now commonplace to access websites from multiple devices with
multiple screen sizes, so it is important to consider if your website is mobile friendly. If your website
is not mobile friendly, you can either rebuild it in a responsive layout (this means your website will
adjust to different screen widths) or you can build a dedicated mobile site (a separate website
optimized specifically for mobile users).
4) Grid based layouts: Placing content randomly on your web page can end up with a
haphazard appearance that is messy. Grid based layouts arrange content into sections, columns and
boxes that line up and feel balanced, which leads to a better-looking website design.

5) Communication: People on the web tend to want information quickly, so it is important to


communicate clearly, and make your information easy to read and digest. Some effective tactics to
include in your web design include: organizing information using headlines and sub headlines, using
bullet points instead of long windy sentences, and cutting the waffle.

6) Purpose: Good web design always caters to the needs of the user. Are your web visitors
looking for information, entertainment, some type of interaction, or to transact with your business?
Each page of your website needs to have a clear purpose, and to fulfill a specific need for your
website users in the most effective way possible.

7) Typefaces: In general, Sans Serif fonts such as Arial and Verdana are easier to read online
(Sans Serif fonts are contemporary looking fonts without decorative finishes). The ideal font size for
reading easily online is 16px and stick to a maximum of 3 typefaces in a maximum of 3-point sizes to
keep your design streamlined.

8) Colours: A well thought out colour palette can go a long way to enhance the user experience.
Complementary colours create balance and harmony. Using contrasting colours for the text and
background will make reading easier on the eye. Vibrant colours create emotion and should be used
sparingly (e.g. for buttons and call to actions). Last but not least, white space/ negative space is very
effective at giving your website a modern and uncluttered look.

9) Image: A picture can speak a thousand words, and choosing the right images for your website
can help with brand positioning and connecting with your target audience. If you don’t have high
quality professional photos on hand, consider purchasing stock photos to lift the look of your
website. Also consider using infographics, videos and graphics as these can be much more effective
at communicating than even the most well written piece of text.

10) “F” Pattern design: Eye tracking studies have identified that people scan computer
screens in an “F” pattern. Most of what people see is in the top and left of the screen and the right
side of the screen is rarely seen. Rather than trying to force the viewer’s visual flow, effectively
designed websites will work with a reader’s natural behaviour and display information in order of
importance (left to right, and top to bottom).

You might also like