WebService 1 Intro

Introduction to Web Services
  • Web applications – are software systems that are designed to be accessed by end users through browsers or other web client software.
  • Some software systems – are also designed to be accessed using web protocols, but are intended to be used by other software applications rather than directly by end users è designed to provide services to software applications
  • Because these services are intended to be accessed using web protocols and technologies, they are called web services.

 


 

  • At their lowest levels, web services are typically based on transmitting XML documents between clients and servers via HTTP.
    • The vocabulary used for these documents is called SOAP. (Simple Object Access Protocol)
      • SOAP provides conventions for representing structured data, such as arrays and objects.
    • Web Services Definition Language (WDSL) – XML vocabulary – is used to describe the operations provided by a web service.
      • Describing an operation includes
        • defining the data to be passed from the client to the operation (using SOAP)
        • and the return value of the operation (also represented using SOAP).
    • XML Schema – XML vocabulary – used to define data within a WSDL

 


 

Web Service Concepts

 

  • Web service is a special type of web application.
  • A web service servlet accepts HTTP requests from clients and provides an HTTP response for each request received.
  • However, unlike servlets, a web service servlet expects that each HTTP request it receives will contain a SOAP XML document in the body of the request.
  • This SOAP document specifies an operation to be performed by the web service and supplies input data for that operation.
  • Low-level communication between web service clients and servers is normally carried out using HTTP and SOAP,
  • Tools exist for writing web service code at high levels that hides these implementation details.
  • A key to making these tools possible is an XML vocabulary for describing web services, the Web Service Definition Language (WSDL).
  • A WSDL document for a web service identifies
    • The operations provided by the web service,
    • What the input data to each operation is, and
    • What output data is produced by the operation.

 


 

WSDL Document 
  • WSDL document supplies
    • names for an operation
    • its input/output parameters and
    • data types for the parameters.
  • The data types in a WSDL document are defined using yet another XML vocabulary, XML Schema.
  • A WSDL document is, in essence, an API specification – it tells us what operations (methods) a web service has, the data types of an operation’s input parameters, and the data type of its return value.
  • High-level tools exist that can read a WSDL document and produce code that implements the API specified.
  • The implementation will handle all of the details of
    • converting an API method call into the corresponding SOAP document,
    • embedding this document in an HTTP request,
    • sending the request to the appropriate operation of the web service, and
    • then unpacking the data contained in the reply SOAP message into the appropriate return-value data type as specified by the API.
  • Once the high-level tool has generated such an API implementation, the implementation can be called on by user-written code in order to access the web service.

 


 

  • This chapter illustrates
    • Technologies used (JAX-RPC, SOAP).
    • How these various web services technologies interact.