Chapter 8 - DS
Chapter 8 - DS
Lecture Seven:
Web Services
Communication Patterns
In general, web services use either a synchronous
request-reply pattern of communication with their
clients or they communicate by asynchronous
messages.
To allow for a variety of patterns, SOAP is based on
the packaging of single one-way messages.
SOAP is used to hold RPC style parameters or
entire documents.
Originally, SOAP was based on HTTP, but the
current version may be used over different
transport protocols (SMTP, TCP, UDP, or HTTP)
Web Services: SOAP based Web services
Service References
URI’s – Uniform Resource Identifiers
URL’s – Uniform Resource Locator URI’s that include
location information
resources pointed to by URL’s are hard to move
Servlet container
The service implementation is run as a servlet inside a servlet
container whose role is to load, initialize and execute servlets
The servlet container includes a dispatcher and skeletons
when a request arrives, the dispatcher maps it to a particular skeleton,
which translates it into Java and passes on the request to the appropriate
method in the servlet
That method carries out the request and produces a reply, which the
skeleton translates back into a SOAP reply
The URL of a service consists of a concatenation of the URL of the servlet
container and the service category and name
e.g, http://localhost:8080/ShapeList-jaxrpc/ShapeList
Tomcat [jakarta.apache.org] is a commonly used servlet container The
client program
may use static proxies (generated at compile time, example below),
dynamic proxies or dynamic invocation interface
Web Services: SOAP based Web services
WS Directory Service
Universal Description, Discovery and
XML security
Signing and encrypting
Web Services: SOAP based Web services
Elements
Components – Proxy , gateway etc
Connectors – client , server etc
Data – resource , representation etc
REST
Ignores component implementation details.
Focus on roles of components, their interactions and their
interpretation of data elements.
Web Services: REST based Web services
Rest – An architectural Style
Resource
URI-Uniform Resource
Identifier (or URL)
Online shopping
Search services
Dictionary services
Web Services: REST based Web services
Rest – An architectural Style
REST way of Implementing the web services
Service – Get parts list
<?xml version="1.0"?>
<p:Parts xmlns:p="http://www.parts-depot.com" xmlns:xlink="http://www.w3.org/1999/xlink">
<Part id="00345" xlink:href="http://www.parts-depot.com/parts/00345"/>
<Part id="00346" xlink:href="http://www.parts-depot.com/parts/00346"/>
<Part id="00347" xlink:href="http://www.parts-depot.com/parts/00347"/>
<Part id="00348" xlink:href="http://www.parts-depot.com/parts/00348"/>
</p:Parts>
Service – Get detailed part data