Docstoc

web-services

Document Sample
web-services Powered By Docstoc
					Web Services….

XML Web Service?
• A programmable component
Platform: Windows
Previously

– Provides a particular function for an application – Can be published, located, and invoked across the Web

COM Component

RPC
Difficult to run through Firewalls

• Based on Internet technologies

Platform: any platform

.NET
Easy to run through Firewalls

– SOAP, XML and transport protocols such as HTTP, SMTP

Component

SOAP over HTTP

Why Use XML Web Services?

!" " " " #

Evolution to Web Services
XML Is the Glue

Data Access Application Models
Evolution of data access
! "
$ % &

#

! "

$% &' (

*%

)% %

Web Services Overview
What Is a Web Service?

• The solution? Web Services! • A Web Service exposes functionality to a consumer
– Over the Internet or intranet – A programmable URL – Functions you can call over the Internet

• Based on Web standards
– HTTP, XML, SOAP, WSDL, UDDI, with more to come

• Can be implemented in any language on any platform • Black boxes
– Component-like, reusable

Web Services Overview
What Is a Web Service?

• A Web Service combines the best features of distributed computing and portals and eliminates the worst
– Provides a mechanism for invoking methods remotely – Uses Web standards (e.g. HTTP, XML) to do so

Web Services Overview
What Is a Web Service?

• Web Services allow you to interconnect:
– – – – Different companies Many/any devices Applications Different clients
• Not just browsers

• Distribution and integration of application logic • Enable the programmable Web
– Not just the purely interactive Web

• Web Services are loosely coupled

Web Services Overview
What is a Web Service?

• • • • •

New paradigm for Internet development Deliver applications as services Richer, customer-driven experience Continuous delivery of value/bits Third-generation Internet

Web Services Overview
Evolution of the Web

HTML

HTML

HTML, XML

HTML, XML

Static HTML

Generation 1

Web Applications

Generation 2

Web Services

Generation 3

Web Services Overview
Benefits

• Everyone
– Leverage existing infrastructure – “Build or buy” development decisions – Minimize development time/costs

• Enterprises
– Integration imperative – Dynamic, easy B2B relationships

• New Web-based businesses
– Greater personalization – New services/new revenue streams – Be “everywhere” vs. single destination

Underlying Technologies
Web Services Stack Directory: Publish & Find Services: Inspection: Find Services on server: Description: Formal Service Descriptions: Wire Format: Service Interactions: Universal Data Format: Ubiquitous Communications: UDDI DISCO WSDL SOAP XML Internet

Simple, Open, Broad Industry Support

XML Web Services Message Flow
Phase I Serialize

SOAP MESSAGE

SOAP Request

Phase II Deserialize

SOAP MESSAGE Web Servic e

Client Proxy

Network

Phase IV Deserialize

SOAP MESSAGE

SOAP Response

SOAP MESSAGE

Phase III Serialize

Underlying Technologies
Web Services Stack

• Discovery
– Directory allows potential clients to locate relevant Web Services
• UDDI

– Inspection allows you to locate documents about Web Services located on at a given URL
• DISCO

– A Description language defines the format of methods provided by a Web Service
• WSDL

Underlying Technologies
Web Services Stack

http://www.uddi.org Locate a Service Link to Discovery Document (XML)

Directory

UDDI or other directory service

Web Service Client

http://www.ibuyspy.com/ibuyspy.disco Request Discovery Document Return Discovery Document (XML) http://www.ibuyspy.com/ibuyspycs/InstantOrder.asmx?wsdl Request Service Description Return Service Description (XML)

Inspection

Description

Web Service

Wire Format
Request Service Return Service Response (XML)

Underlying Technologies
Web Service Wire Format - SOAP

• The Web Service Wire Format specifies how specific messages are exchanged
– HTTP-GET – HTTP-POST – SOAP

• HTTP-GET and HTTP-POST use a minimal HTTP interface to invoke Web Services
– Limited support for data types

• SOAP provides a robust HTTP/XML interface
– Extensive support for data types

SOAP

Overview

• Guiding principle: “Invent no new technology” • Builds on key Internet standards
– SOAP HTTP + XML – Submitted to W3C

• The SOAP specification defines:
– – – – The SOAP message format How to send messages How to receive responses Data encoding

SOAP

SOAP Is Not…

• Objects-by-reference
– Distributed garbage collection – Bi-directional HTTP

• Activation • Complicated
– Doesn’t try to solve every problem in distributed computing – Can be easily implemented

SOAP

The HTTP Aspect

• SOAP requests

"

! ! #$ ! % $! ()* .# /',0 0

"

%

&&'

+, + +

" !1 !1 -

0

SOAP

Message Structure
SOAP Message Headers SOAP Envelope SOAP Header Headers SOAP Body Message Name & Data
The complete SOAP message Protocol binding headers +1 + & 0 encloses payload 0 encloses headers

Individual headers +2 & 0 contains SOAP message name XML-encoded SOAP message name & data

SOAP

SOAP Message Format

• An XML document using the SOAP schema:
+, + + + + " .# !1 ! & /',0 0 0

! & 0 !2 & 0 + && .#$ + 0 3+ 0 + 30 /+ 30 + &&0 + !2 & 0 + !1 0

!

"

% '0

SOAP

Server Responses

• Server replies with a “result” message:
3// 4

! % $! (5 +, + + " .# /',0 !1 0 !2 & 0 + &&6 .#$ + 03) *+ + &&6 0 + !2 & 0 + !1 0

! 0

"

% '0

SOAP

Encoding Complex Data

• Data structures are serialized as XML:
+ !1 0 + !2 & 0 +7 8 6 .#$ ! + 0 + " " 0 " 9 " + " 0 35+ " 0 + " 8 0 + " 8 0 + 0 + 7 8 6 0 + !2 & 0 + !1 0

" &+

% '0 " " 0

WSDL

WSDL Elements

• Open – allows for other namespaces and thus highly extensible • Ability to import other schemas & WSDL • Provides “source” for Web Services • Provides both interface and implementation details • Allows for separation of the two

XML Web Services Infrastructure
Directory
1) Client attempts to locate a Web service 2) URL to discovery document is returned

Discovery
3) Client requests discovery document 4) Discovery document is returned 5) Client requests service description 6) Description document is returned

Description

Wire Format
7) Client requests the web service 8) Web service returns result response

Questions?


				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:59
posted:9/29/2009
language:English
pages:26