Skip to content

Web Service

  • Software system designed to support interoperable machine-to-machine interaction over a network

Terminology

  • Request and Response: input & output
  • Message Exchange Format: xml, json, format
  • Service Provider (Server): hosts the web service
  • Service Consumer (Client): consumes the web service
  • Service Definition: contract between provider and consumer
  • Transport: HTTP (all the web), MQ (websphere MQ - SOAP layer)

  • Service Definition

  • Request/Response Format
  • Request Structure
  • Response Structure
  • Endpoint
  • Operations

Web Service Groups

  • SOAP (Simple Object Access Protocol)
  • XML Request exchange format
  • Specific XML Request Envelope format
    • The envelope contains a header and a body
  • Transport over HTTP or MQ
  • Service Definition WSDL
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/">
  <SOAP-ENV:Header />
  <SOAP-ENV:Body>
    <ns2:getCourseDetailsRequest>
      <ns2:course>
        <ns2:id>Course1</ns2:id>
        <ns2:name>Spring</ns2:name>
        <ns2:description>Awesome Spring Course</ns2:description>
      </ns2:course>
    </ns2:getCourseDetailsRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
  • REST (REpresentational State Transfer)
  • Uses HTTP Methods (GET, POST, PUT, DELETE, ...)
  • Uses HTTP Status Codes
  • Resource has an URI /users/Ranga/todos/1
  • No restriction on exchange format (although json is the most popular)
  • Transport is only via HTTP!
  • Service Definition WADL, Swagger, ...