Web Service
- Software system designed to support interoperable
machine-to-machine
interaction
over anetwork
Terminology
Request and Response
: input & outputMessage Exchange Format
: xml, json, formatService Provider (Server)
: hosts the web serviceService Consumer (Client)
: consumes the web serviceService 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 abody
- The envelope contains a
- Transport over
HTTP
orMQ
- 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
, ...