1 of 25

Web Services

2 of 25

Introduction

  • A web service is an instance of a more general notion of a service:

“an act or performance offered by one party to another. Although the process may be tied to a physical product, the performance is essentially intangible and does not normally result in ownership of any of the factors of production”.

  • The essence of a service, therefore, is that the provision of the service is independent of the application using the service.
  • Service providers can develop specialized services and offer these to a range of service users from different organizations.

3 of 25

Service Oriented Architecture

  • A means of developing distributed systems where the components are stand-alone services
  • Services may execute on different computers from different service providers
  • Standard protocols have been developed to support service communication and information exchange

4 of 25

Service Oriented Architecture

5 of 25

Benefits of SOA

  • Services can be provided locally or outsourced to external providers
  • Services are language-independent
  • Investment in legacy systems can be preserved
  • Inter-organizational computing is facilitated through simplified information exchange

6 of 25

Key Standards

  • SOAP
    • A message exchange standard that supports service communication
  • WSDL (Web Service Definition Language)
    • This standard allows a service interface and its bindings to be defined
  • WS-BPEL
    • A standard for workflow languages used to define service composition

7 of 25

Web Services Standards

8 of 25

RESTful Web Services

  • Current web services standards have been criticized as ‘heavyweight’ standards that are over-general and inefficient.
  • REST (REpresentational State Transfer) is an architectural style based on transferring representations of resources from a server to a client.
  • This style underlies the web as a whole and is simpler than SOAP/WSDL for implementing web services.

9 of 25

RESTful Web Services

  • RESTFul services involve a lower overhead than so-called ‘big web services’ and are used by many organizations implementing service-based systems that do not rely on externally-provided services.

10 of 25

Case Study

  • An in-car information system provides drivers with information on weather, road traffic conditions, local information etc. This is linked to car radio so that information is delivered as a signal on a specific radio channel.
  • The car is equipped with GPS receiver to discover its position and, based on that position, the system accesses a range of information services. Information may be delivered in the driver’s specified language.

11 of 25

Case Study

12 of 25

Benefits of SOA

  • It is not necessary to decide when the system is programmed or deployed what service provider should be used or what specific services should be accessed.

    • As the car moves around, the in-car software uses the service discovery service to find the most appropriate information service and binds to that.
    • Because of the use of a translation service, it can move across borders and therefore make local information available to people who don’t speak the local language.

13 of 25

Service-Oriented SE

  • Existing approaches to software engineering have to evolve to reflect the service-oriented approach to software development
    • Service engineering - The development of dependable, reusable services
    • Software development with services - The development of dependable software where services are the fundamental components

14 of 25

Web Service Description Language

  • The service interface is defined in a service description expressed in WSDL (Web Service Description Language).
  • The WSDL specification defines
    • What operations the service supports and the format of the messages that are sent and received by the service
    • How the service is accessed - that is, the binding maps the abstract interface onto a concrete set of protocols
    • Where the service is located. This is usually expressed as a URI (Universal Resource Identifier)

15 of 25

Organization of a WSDL Specification

16 of 25

WSDL Specification Components

  • The ‘what’ part of a WSDL document, called an interface, specifies what operations the service supports, and defines the format of the messages that are sent and received by the service.
  • The ‘how’ part of a WSDL document, called a binding, maps the abstract interface to a concrete set of protocols. The binding specifies the technical details of how to communicate with a Web service.

17 of 25

WSDL Specification Components

  • The ‘where’ part of a WSDL document describes the location of a specific Web service implementation (its endpoint).

18 of 25

Service Engineering

  • The process of developing services for reuse in service-oriented applications
  • The service has to be designed as a reusable abstraction that can be used in different systems.
  • Generally useful functionality associated with that abstraction must be designed and the service must be robust and reliable.
  • The service must be documented so that it can be discovered and understood by potential users.

19 of 25

The Service Engineering Process

20 of 25

Stages of Service Engg.

  • Service candidate identification, where you identify possible services that might be implemented and define the service requirements.
  • Service design, where you design the logical and WSDL service interfaces.
  • Service implementation and deployment, where you implement and test the service and make it available for use.

21 of 25

Service Classification

Utility

Business

Coordination

Task

Currency converter

Employee locator

Validate claim form

Check credit rating

Process expense claim

Pay external supplier

Entity

Document style checker

Web form to XML converter

Expenses form

Student application form

22 of 25

Service Testing

Testing is intended to find defects and demonstrate that a system meets its functional and non-functional requirements.

Service testing is difficult as (external) services are ‘black-boxes’. Testing techniques that rely on the program source code cannot be used.

23 of 25

Service Testing Problems

  1. External services may be modified by the service provider thus invalidating tests which have been completed.
  2. Dynamic binding means that the service used in an application may vary - the application tests are not, therefore, reliable.
  3. The non-functional behaviour of the service is unpredictable because it depends on load.

24 of 25

Service Testing Problems

  1. If services have to be paid for as used, testing a service may be expensive.
  2. It may be difficult to invoke compensating actions in external services as these may rely on the failure of other services which cannot be simulated.

25 of 25

Key points

  1. Service-oriented software engineering is based on the notion that programs can be constructed by composing independent services which encapsulate reusable functionality.
  2. Service interfaces are defined in WSDL. A WSDL specification includes a definition of the interface types and operations, the binding protocol used by the service and the service location.
  3. Services may be classified as utility services, business services or coordination services.