Web Services 技术架构

29
Web Services 技技技技 技技技 MCT/MVP 技技技技技技

description

Web Services 技术架构. 杨永智 MCT/MVP 微软校园大使. Web Services 开发系列讲座. Web Services 技术架构 利用 Visual Web Developer Express 2005 开发 Web Services Web Services 应用 Web Services 高级特性. 日程. Web Serivces 介绍 Web Services 的优点 Web Services 技术 SOAP WSDL UDDI SOA ( 面向服务的架构 ). Web Serivces 介绍. - PowerPoint PPT Presentation

Transcript of Web Services 技术架构

Page 1: Web Services  技术架构

Web Services 技术架构杨永智MCT/MVP微软校园大使

Page 2: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web ServicesWeb Services 开发系列讲座开发系列讲座Web Services Web Services 技术架构技术架构利用利用 Visual Web Developer Express 2005 Visual Web Developer Express 2005 开发 开发 Web ServicesWeb ServicesWeb Services Web Services 应用应用Web Services Web Services 高级特性高级特性

Page 3: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

日程日程

Web SerivcesWeb Serivces 介绍介绍Web ServicesWeb Services 的优点的优点Web Services Web Services 技术技术

SOAPSOAPWSDLWSDLUDDIUDDI

SOA (SOA ( 面向服务的架构面向服务的架构 ))

Page 4: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web SerivcesWeb Serivces 介绍介绍

What’s Web Services What’s Web Services Web Services Web Services 应用-互连设备应用-互连设备Web Services Web Services 应用-整合应用应用-整合应用

Page 5: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

What’s Web ServicesWhat’s Web Services

Web Services Web Services 是什么是什么AnywhereAnywhere 、、 AnytimeAnytime 、、 AnyDeviceAnyDevice能够在一个分布式的计算环境中动态地描述、能够在一个分布式的计算环境中动态地描述、发布、发现和调用服务发布、发现和调用服务WebWeb 上的对象访问技术………上的对象访问技术……… ....

Why We Need Web ServicesWhy We Need Web Services软件变服务软件变服务整合孤立的数据孤岛整合孤立的数据孤岛互连设备与异构系统互连设备与异构系统EAI/B2BEAI/B2B 应用应用…………………………

完全基于 XML 以及其他相关的 Internet 标准

Page 6: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 应用-互连设备应用-互连设备

Page 7: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 应用-整合应应用-整合应用用

ApplicationApplicationApplicationApplication

ApplicationApplicationApplicationApplication

ApplicationApplicationApplicationApplication

XML

XML

XMLXML

XMLXML

XMLXML

XMLXML

XMLXML

XM

LX

ML XM

LXM

L

XMLXML

Page 8: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

日程日程

Web SerivcesWeb Serivces 介绍介绍Web ServicesWeb Services 的优点的优点Web Services Web Services 技术技术

SOAPSOAPWSDLWSDLUDDIUDDI

SOA (SOA ( 面向服务的架构面向服务的架构 ))

Page 9: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web ServicesWeb Services 的优点的优点主流分布式应用技术的缺点主流分布式应用技术的缺点Web ServicesWeb Services 的优点的优点

Page 10: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

主流分布式应用技术的缺点主流分布式应用技术的缺点目前的分布式对象技术各自为政目前的分布式对象技术各自为政 互操作性差互操作性差 紧密耦合紧密耦合 局限在局限在 IntranetIntranet 的应用的应用

DCOM CORBA

RPC IIOP

NDR CDR

IDL OMG IDL

RPC 通讯协议

消息格式

描述语言

Windows Registry Naming Service探索机制

Java RMI

IIOP or JRMP

Java Ser. Format

Java

RMI Registry or JNDI

Page 11: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web ServicesWeb Services 的优点的优点业界接受的标准业界接受的标准跨不同语言跨不同语言跨异构应用跨异构应用跨异构平台跨异构平台跨跨 InternetInternet 的互操作技术的互操作技术““ 软件变服务“远景的支撑技术软件变服务“远景的支撑技术

Page 12: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web servicesWeb services 业界组织业界组织超过超过 160160 家公司家公司加入的联盟加入的联盟

达成异构平台达成异构平台、、异构应用异构应用、不同、不同语言间语言间的的互操作规互操作规范范通过通过 Web servicesWeb services 推动产业发展的新一波浪潮推动产业发展的新一波浪潮

www.ws-i.orgwww.ws-i.org

Page 13: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Page 14: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

日程日程

Web SerivcesWeb Serivces 介绍介绍Web ServicesWeb Services 的优点的优点Web Services Web Services 技术技术

SOAPSOAPWSDLWSDLUDDIUDDI

SOA (SOA ( 面向服务的架构面向服务的架构 ))

Page 15: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 技术技术Web ServicesWeb Services 协议栈协议栈Web Services Web Services 工作流程工作流程SOAPSOAPWSDLWSDLUDDIUDDIDemoDemo

Page 16: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 协议栈协议栈

Page 17: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 协议栈协议栈Machine A Machine B

Invoke

WSDLproxy

WSDLstub

HTTP + SOAP1

Web Service

UDDI Server4

WSDL

WSDL

WSDL

3 WSDL

request

response

1 通讯协议2 消息格式

描述语言3

发现机制4

XML

2

Page 18: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

那给我用用吧 那给我用用吧 (SOAP)(SOAP)

Web Services Web Services 工作流程工作流程

Design-Time or DynamicDesign-Time or Dynamic RuntimeRuntime

你都有什么服务啊你都有什么服务啊 ? (WSDL)? (WSDL)

http://yourservice.com/?WSDLhttp://yourservice.com/?WSDL

XML with service XML with service 描述描述

http://yourservice.com/svc1http://yourservice.com/svc1

XML/SOAP BODYXML/SOAP BODY

Web Web ServiceService

WebWebService Service 客户端客户端

UDDIUDDI

查找服务查找服务http://www.uddi.orghttp://www.uddi.org

链接到 链接到 DISCO DISCO 或者 或者 WSDL WSDL 文档文档

Page 19: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

SOAPSOAP

SSimple imple OObject bject AAccess ccess PProtocolrotocol自由的传输绑定 自由的传输绑定 (( 不仅仅是不仅仅是 HTTP)HTTP)自由的语言绑定 自由的语言绑定 (( 比如比如 Java, C#)Java, C#)可插入的数据格式 可插入的数据格式 (( 当然必须基于当然必须基于 XML)XML)完全的中立 完全的中立 (( 中立、公开的标准中立、公开的标准 ))独立于任何编程语言、对象模型、操作系统、平独立于任何编程语言、对象模型、操作系统、平台台

Page 20: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

A SOAP Request MessageA SOAP Request Message

<SOAP-ENV:Envelope <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://{soaporg}/envelope/"xmlns:SOAP-ENV="http://{soaporg}/envelope/"SOAP-ENV:encodingStyle=SOAP-ENV:encodingStyle="http://{soaporg}/encoding/">"http://{soaporg}/encoding/">

<SOAP-ENV:Body><SOAP-ENV:Body> <m:QuoteStockPrice xmlns:m="Some-URI"><m:QuoteStockPrice xmlns:m="Some-URI"> <Symbol>MSFT</Symbol><Symbol>MSFT</Symbol> </m:QuoteStockPrice></m:QuoteStockPrice></SOAP-ENV:Body></SOAP-ENV:Body>

</SOAP-ENV:Envelope></SOAP-ENV:Envelope>

Page 21: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

A SOAP Response A SOAP Response MessageMessage<SOAP-ENV:Envelope <SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://{soaporg}/envelope/"xmlns:SOAP-ENV="http://{soaporg}/envelope/"SOAP-ENV:encodingStyle=SOAP-ENV:encodingStyle="http://{soaporg}/encoding/">"http://{soaporg}/encoding/">

<SOAP-ENV:Body><SOAP-ENV:Body> <m:QuoteStockPriceResponse<m:QuoteStockPriceResponse

xmlns:m="Some-URI"> xmlns:m="Some-URI"> <Price>78.2</Price><Price>78.2</Price> </m:QuoteStockPriceResponse></m:QuoteStockPriceResponse></SOAP-ENV:Body></SOAP-ENV:Body>

</SOAP-ENV:Envelope></SOAP-ENV:Envelope>

Page 22: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

WSDLWSDL (( WWeb eb SServices ervices DDescription escription LLanguageanguage ))

使用使用 XMLXML 进行描述进行描述类似类似 IDL, IDL, 不过是使用不过是使用 XMLXML 格式格式

描述了服务的操纵信息描述了服务的操纵信息Service InterfaceService InterfaceImplementation DetailsImplementation DetailsAccess ProtocolAccess ProtocolContact EndpointContact Endpoint

WSDLWSDL 是早先技术的综合是早先技术的综合IBM's NASSLIBM's NASSLMicrosoft's SDLMicrosoft's SDL

Page 23: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

UDDIUDDI

UDDIUDDI 的两个重要部分的两个重要部分UDDI API UDDI API (( SOAP APISOAP API ))UDDI DataStructureUDDI DataStructure

UDDIUDDI 的作用-的作用- InternetInternet 上的上的 Web ServiceWeb Servicess 的黄页簿的黄页簿UUniversal niversal DDescription, escription, DDiscovery and iscovery and IIntentegrationgration

Page 24: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

DemoDemo

演示:演示: Microsoft UDDI Operator SiteMicrosoft UDDI Operator Site

Page 25: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

日程日程

Web SerivcesWeb Serivces 介绍介绍Web ServicesWeb Services 的优点的优点Web Services Web Services 技术技术

SOAPSOAPWSDLWSDLUDDIUDDI

SOA (SOA ( 面向服务的架构面向服务的架构 ))

Page 26: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

SOASOA -面向服务的架构-面向服务的架构

Service BrokerService Broker

Service ProviderService ProviderService ConsumerService Consumer

Publish Find

Bind

Page 27: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

Web Services Web Services 中的中的 SOASOA

UDDIUDDI

Any ClientAny Client

SOAP SOAP

SOAP

IISIIS

Web ServiceWeb Service

Page 28: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn

总结总结

Web SerivcesWeb Serivces 介绍介绍Web ServicesWeb Services 的优点的优点Web Services Web Services 技术技术

SOAPSOAPWSDLWSDLUDDIUDDI

SOA (SOA ( 面向服务的架构面向服务的架构 ))

Page 29: Web Services  技术架构

www.msuniversity.edu.www.msuniversity.edu.cncn