CS6320:  SW Engineering of Web Based Systems

 

Web Services

Featuring agility, shorter release cycles and quicker response time, Web Services use open Internet standards, such as HTTP, REST (or not used anymore SOAP), and XML, to construct distributed Web-based applications, including e-commerce and supply chain management, in an object-oriented, multi-lingual, and cross-platform environment.

Web services are loosely coupled, reusable software components that semantically encapsulate discrete functionality and are distributed and programmatically accessible over standard Internet protocols. Specifically, web services are a stack of emerging standards that describe a service-oriented, component-based application architecture. Conceptually, web services represent a model in which discrete tasks within e-business processes or applications are distributed widely throughout a value net.
these software components are loosely coupled. Traditional application design depends upon a tight interconnection of all subsidiary elements. The complexity of these connections requires that developers thoroughly understand and have control over both ends of the connection; moreover, once established, it is exceedingly difficult to extract one element and replace it with another. Loosely coupled systems, on the other hand, require a much simpler level of coordination and allow for more flexible reconfiguration.
web services semantically encapsulate discrete functionality. A web service is a self-contained component that performs a single task. The component describes its own inputs and outputs in a way that other software can determine what it does, how to invoke its functionality, and what result to expect in return.
web services can be accessed programmatically. Unlike web sites and desktop applications, web services are not designed for direct human interaction, and they do not have a graphical user interface. Rather, web services operate at the code level; they are called by and exchange data with other software. Web services certainly will be incorporated into software designed for human interaction, however.
web services are distributed over Internet or Intranet. Web services make use of existing, ubiquitous transport protocols like HTTP. Web services leverage existing infrastructure and can comply with current corporate firewall policies.

 

 

Invoking a Web Service

1) a business application sends a request to a service at a given URL using HTTP.
2) The service receives the request, processes it, and returns a response.

Example:

An often-cited example of a Web service is that of a stock quote service, in which the request asks for the current price of a specified stock, and the response gives the stock price. This is one of the simplest forms of a Web service in that the request is filled almost immediately, with the request and response being parts of the same method call.

 

 

NOTE: NO ONE DOES SOAP WEB SERVICES ANYMORE --- DO REST

Practically no one uses SOAP anymore and all services are REST (like Facebook API or Twitter API or Google APIs).

See http://www.infoworld.com/article/2613314/application-development/web-services-are-dead----long-live-rest.html

http://www.infoq.com/articles/rest-soap

 

 

REST Services

  • Good GENERAL tutorial http://rest.elkstein.org/
  • Oracle website on REST and J2EE http://docs.oracle.com/javaee/6/tutorial/doc/gijqy.html (or for more current search on Oracle website)


    As illustrated below: A REST based webservice uses: HTTP, XML and REST-based Communications to invoke WebService (implemented in any language like a J2EE server-side app) and Return typically XML (or possibly JSON) encoded results.
  • REST is modeled on how normal WWW interactions are done and really makes it like HTTP requests.
    • Here is what Oracle has to say
    • he following principles encourage RESTful applications to be simple, lightweight, and fast:
      • Resource identification through URI: A RESTful web service exposes a set of resources that identify the targets of the interaction with its clients. Resources are identified by URIs, which provide a global addressing space for resource and service discovery. See The @Path Annotation and URI Path Templates for more information.
      • Uniform interface: Resources are manipulated using a fixed set of four create, read, update, delete operations: PUT, GET, POST, and DELETE. PUT creates a new resource, which can be then deleted by using DELETE. GET retrieves the current state of a resource in some representation. POST transfers a new state onto a resource. See Responding to HTTP Methods and Requests for more information.
      • Self-descriptive messages: Resources are decoupled from their representation so that their content can be accessed in a variety of formats, such as HTML, XML, plain text, PDF, JPEG, JSON, and others. Metadata about the resource is available and used, for example, to control caching, detect transmission errors, negotiate the appropriate representation format, and perform authentication or access control. See Responding to HTTP Methods and Requests and Using Entity Providers to Map HTTP Response and Request Entity Bodies for more information.
      • Stateful interactions through hyperlinks: Every interaction with a resource is stateless; that is, request messages are self-contained. Stateful interactions are based on the concept of explicit state transfer. Several techniques exist to exchange state, such as URI rewriting, cookies, and hidden form fields. State can be embedded in response messages to point to valid future states of the interaction. See Using Entity Providers to Map HTTP Response and Request Entity Bodies and “Building URIs” in the JAX-RS Overview document for more information.



 

 

 

Historical Read only (NOT REQUIRED below) on SOAP

Example

Taxi Example

 

Supporting Technologies

Web Services Description Language (WSDL)
Simple Object Access Protocol (SOAP)

Universal Description, Discovery and Integration (UDDI), UDDI As Yellow Pages.

Registry provide a means for describing Web services and their methods.

XML - to represent data.

Java Naming and Directory Interface(JNDI), Java API for XML Processing (JAXP), Simple API for XML (SAX),

Java Web Services Tutorial

 

 

 

© Lynne Grewe