Web Service

1. W3C Definition

Software system designed to support inter operable machine-to-machine interaction over a network

2. 3 Keys

- Designed for machine-to-machine (or application-to-application) interaction
- Should be inter operable - not platform dependent
- Should allow communication over a network

3.Communication between applications

Application -[Request]-> WebService
WebService -[Respons]-> Application A

Service Provider or Server
Service Consumer or Client
Service Definition

Transport -> HTTP and MQ


4. Request and Response Formats /Message Exchange Format:

a) XML

<getCourseDetailsRequest>
    <id>Course1</id>
</getCourseDetailsRequest>

b) JSON

[
  {
    "id": 1,
    "name": "Even",
    "birthDate": "2017-07-10T07:52:48.270+0000"
  },
  {
    "id": 2,
    "name": "Abe",
    "birthDate": "2017-07-10T07:52:48.270+0000"
  }
]


5. Service Definition

a) Request/Response Format

b) Request Structure

c) Response Structure

d) Endpoint

6. Web Service Groups 

a) SOAP-based

Facebook-[XML Request]-> Todo Application
Todo Application -[XML Response]-> Facebook

<getCourseDetailsRequest>
    <id>Course1</id>
</getCourseDetailsRequest>


Format:

SOAP-ENV: Envelope
SOAP-ENV: Header
SOAP-ENV: Body

Soap Header is optional


Response:

<SOAP-ENV:Envelope xmlns: SOAP-ENV="http://schemas.xmlsoap.org/....
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
     <ns:getCourseDetailsResponse xmlns:ns2="http://in28...
        <ns2:course>
           <ns2:id>Course1</ns2:id>
           <ns2:name>Spring</ns2:name>
           <ns2:description>10 Steps</ns2:description>
        </ns2:course>
     </ns:getCourseDetailsResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


-Format
  *SOAP XML Request
  *SOAP XML Response
-Transport
  *SOAP over MQ
  *SOAP over HTTP
-Service Definition
  *WSDL
    **Endpoint
    **All Operations
    **Request Structure
    **Response Structure

b) REST-styled

- REST (REpresentional State Transfer)
-HTTP Methods (GET, PUT, POST)
-HTTP Status Codes (200, 404 ..)

7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.

Komentarze

Popularne posty z tego bloga

Kubernetes

Helm

Ansible Tower / AWX