Web services. Part 1. Confidential

Содержание

Слайд 2

Part 1 What Are Web Services? Services are everywhere. Why? Web-services

Part 1
What Are Web Services?
Services are everywhere. Why?
Web-services and SOA
History

of Web-services
XML-RPC

Agenda

Слайд 3

What Are Web Services? “Web service is a software system designed

What Are Web Services?

“Web service is a software system designed

to support interoperable machine-to-machine interaction over a network”
By W3C
“Web Services are technology that allows applications to communicate with each other, regardless of the environment via protocols and web interfaces.”
By Wiki
Слайд 4

Web Site "Human-oriented". Graphical user interface (GUI). Web Service Software-oriented. Thus,

Web Site
"Human-oriented".
Graphical user interface (GUI).
Web Service
Software-oriented.
Thus, no GUI / visuals.

?

Web site

vs Web service
Слайд 5

Web Service View Get chart 190 x 400 px Get chart

Web Service View

Get chart
190 x 400 px

Get chart
300 x 200 px

Get

chart
250 x 400 px

Charts Web Service

Financials Web Service

Preference Web Service

Слайд 6

Data aggregation services “Everything” Web Service Public / external Private / internal

Data aggregation services

“Everything” Web Service

Public / external

Private / internal

Слайд 7

Services are everywhere. Why? Database Server Desktop Application Web Application User File Server Web Service

Services are everywhere. Why?

Database
Server

Desktop
Application

Web
Application

User

File Server

Web Service

Слайд 8

Reason #1: Common API Web services are platform-independent. Different (often incompatible)

Reason #1: Common API
Web services are platform-independent.
Different (often incompatible) platforms can

talk to each other via web service.

Services are everywhere. Why?

Web Service

Слайд 9

Reason #2: High compatibility Web services often use simple trusted technologies

Reason #2: High compatibility
Web services often use simple trusted technologies –

XML and HTTP.
HTTP (port 80) is often open even in high-security systems and firewalls.

Services are everywhere. Why?

Web Service

Слайд 10

Reason #3: Black box Internal implementation is hidden from clients. Internal

Reason #3: Black box
Internal implementation is hidden from clients.
Internal system(s) may

be developed, tested, upgraded and deployed separately.

Database
Server

Desktop
Application

Web
Application

File Server

Web Service

Services are everywhere. Why?

Слайд 11

Reason #4: Security Web service API defines allowed manipulations. This provides

Reason #4: Security
Web service API defines allowed manipulations.
This provides limited access

to internal systems.

Services are everywhere. Why?

Database
Server

File Server

Web Service

Слайд 12

Open infrastructure Platform and language transparency Modular design Benefits

Open infrastructure
Platform and language transparency
Modular design

Benefits

Слайд 13

Integrating network-accessible services, which are interoperable because each has an interface

Integrating network-accessible services, which are interoperable because each has an interface

that clearly defines the operations encapsulated in the service.
System, services as building block components may be characterized as unassociated and loosely coupled.

Web services and SOA

Слайд 14

DCE/RPC History of Web-services early 1990s

DCE/RPC

History of Web-services

early 1990s

Слайд 15

History of Web-services > DCE/RPC > IDL /* echo.idl */ [uuid(2d6ead46-05e3-11ca-7dd1-426909beabcd),

History of Web-services > DCE/RPC > IDL

/* echo.idl */
[uuid(2d6ead46-05e3-11ca-7dd1-426909beabcd), version(1.0)]


interface echo {
const long int ECHO_SIZE = 512;
void echo(
[in] handle_t h,
[in, string] idl_char from_client[ ],
[out, string] idl_char from_server[ECHO_SIZE]
);
}
Слайд 16

History of Web-services DCE/RPC MSRPC early 1990s soon

History of Web-services

DCE/RPC
MSRPC

early 1990s
soon

Слайд 17

History of Web-services DCE/RPC MSRPC CORBA early 1990s soon October 1991

History of Web-services

DCE/RPC
MSRPC
CORBA

early 1990s
soon
October 1991

Слайд 18

History of Web-services DCE/RPC MSRPC CORBA COM/OLE early 1990s soon October 1991 1993

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE

early 1990s
soon
October 1991
1993

Слайд 19

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM

early 1990s
soon
October 1991
1993
1993

Слайд 20

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM
XML-RPC

early 1990s
soon
October 1991
1993
1993
1998

Слайд 21

History of Web-services > XML-RPC Request stock.getPrice IBM Response 34.5

History of Web-services > XML-RPC

Request


stock.getPrice


IBM




Response




34.5



Слайд 22

History of Web-services > XML-RPC > Datatypes Integer: or Boolean: with

History of Web-services > XML-RPC > Datatypes

Integer: or
Boolean:

with value of 0/1 or true/false
String:
Double:
Date/time: 19980717T14:08:55
Base64:
Struct:


something
1


Array:


1404
Some string


Nil:
Слайд 23

History of Web-services > XML-RPC vs DCE/RPC XML-RPC Text HTTP (later SMTP) DCE/RPC Binary Any other

History of Web-services > XML-RPC vs DCE/RPC

XML-RPC
Text
HTTP (later SMTP)

DCE/RPC
Binary
Any other

Слайд 24

Benefits and drawbacks Benefits Robust standard with long history and solid

Benefits and drawbacks

Benefits
Robust standard with long history and solid support from

nearly all programming languages
XML-RPC doesn’t need in general any additional “contract” like WSDL, WADL etc.
XML-RPC supports all basic datatypes “out of box”
Drawbacks
XML is too verbose (in comparison with JSON)
Usage of custom datatypes is complicated
Слайд 25

XML-RPC Demo

XML-RPC Demo

Слайд 26

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM
XML-RPC
SOAP 1.0

early 1990s
soon
October 1991
1993
1993
1998
Sep 13,

1999
Слайд 27

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM
XML-RPC
SOAP 1.0
REST

early 1990s
soon
October 1991
1993
1993
1998
Sep 13,

1999
2000
Слайд 28

REST Request/Response Example Request POST /stock Host: www.stocks.com Authorization: Basic xxxxxxxxxxxxxxxxxxx

REST Request/Response Example

Request
POST /stock
Host: www.stocks.com
Authorization: Basic xxxxxxxxxxxxxxxxxxx
Accept: application/json
Content-Length: nnn
Content-Type: application/json
{
“name”:

“IBM”,
“price”: “34.5”
}

Response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: nnn
{
“name”: “IBM”,
“price”: “34.5”
}

Слайд 29

Benefits Can use any encoding (XML, JSON, etc.) Easy and relatively

Benefits
Can use any encoding (XML, JSON, etc.)
Easy and relatively fast implementation
Doesn’t

require contract like WSDL
Reuses HTTP protocol features instead of inventing new
Drawbacks
Not a standard – limited support from programming languages
As it doesn’t have schemas and formal contract might be bad documented

Benefits and drawbacks

Слайд 30

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM
XML-RPC
SOAP 1.0
REST
SOAP 1.1

early 1990s
soon
October 1991
1993
1993
1998
Sep

13, 1999
2000
May 8, 2000
Слайд 31

History of Web-services DCE/RPC MSRPC CORBA COM/OLE MSRPC + COM/OLE =

History of Web-services

DCE/RPC
MSRPC
CORBA
COM/OLE
MSRPC + COM/OLE = DCOM
XML-RPC
SOAP 1.0
REST
SOAP 1.1
SOAP 1.2

early 1990s
soon
October

1991
1993
1993
1998
Sep 13, 1999
2000
May 8, 2000
June 24, 2003
Слайд 32

SOAP Request/Response Example Request POST /stock HTTP/1.1 Host: www.stocks.org Content-Type: application/soap+xml;

SOAP Request/Response Example

Request
POST /stock HTTP/1.1
Host: www.stocks.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">


IBM



Response
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">


34.5



Слайд 33

Benefits Robust standard with long history and solid support from nearly

Benefits
Robust standard with long history and solid support from nearly all

programming languages
WSDL allows automatic method generation and serves as documentation even if there’s no documentation
Allows much more functionality in comparison with XML-RPC
Supports all basic datatypes “out of box”
Allows usage of custom data (XSD-defined)
Drawbacks
XML is too verbose (in comparison with JSON)
Relatively time-consuming development (requires WSDL, XSD)
Standard is too universal – most services don’t use all features

Benefits and drawbacks