390 likes | 402 Views
Dive into the powerful platform for Web Services development with .NET Framework 2.0 and WSE 3.0, simplifying secure and feature-rich service-oriented applications. Explore key WS-* specifications and the transition to Indigo for a unified programming model.
E N D
DEV371Visual Studio 2005 + WSE 3.0Web Services开发的强大平台 杨滔 Developer Evangelist 合作开发部 微软有限公司
日程 • 人们所期望的Web Service • .NET Framework 2.0 + WSE 3.0 • 简便的开发安全的Web Service • 简化面向服务的应用的开发 • 通向Indigo的必经之路 • Indigo,天下归一
什么是 Web Services • 一组为实现丰富和可互操作的通讯的协议和规范 • 通常称作 WS-* 规范 • 规范由Microsoft和其他业界企业一起制定 • 例如 IBM and BEA • 与传输层无关 • 可以使用 HTTP, TCP等等. • 可组合性 • 只使用和应用相关的协议和规范
Web Service Architecture - Web Service全貌 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
2003 2000 2001 2002 2004 2005 Fundamentals Secure, Reliable, Transacted Evolve and Extend WS-I formed WS-I BP 1.0 As of 2/2004 Interoperability Security Roadmap SRT Web Services Whitepaper Reliable Messaging Roadmap Whitepapers WS-Coordination WS-Transaction WS-AtomicTransaction WS-BusinessActivity Transactions WS-ReliableMessaging Reliability WS-Security WS-Federation WS-Federation Active Requestor Profile Security WS-Trust WS-Security Addendum WS-Security Profile for Tokens WS-Security SOAP Message Security WS-Security Username Token Profile WS-Security X.509 Certificate Token Profile WS-Security Kerberos Binding UDDI 1.0 UDDI 2.0 UDDI 3.0 WS-Policy 1.1 WS-PolicyAttachments 1.1 WS-PolicyAssertions 1.1 WS-Inspection WSDL Metadata WS-Discovery WS-MetadataExchange WS-Policy WS-PolicyAttachments WS-PolicyAssertions WS-SecurityPolicy SOAP 1.1 SOAP 1.2 WS-Referral WS-Routing WS-Addressing Messaging WS-Eventing SOAP Messages with Attachments DIME WS-Attachments MTOM
.NET Web Services • ASMX是.NET Framework对基本Web Service的实现 • 支持基本的Web Service • 没有实现 WS-* 规范 • WSE是对 .NET Framework的扩展 • 可以扩展ASMX的行为 • 支持部分WS-*规范 • Indigo是新一代的Web service的实现 • 对WS-*, messaging, queuing, transactions提供统一的编程模型
Web Services ArchitectureASP.NET Web Services 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
Web Services ArchitectureWeb Services Enhancements 3.0 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
WSE 3.0和VS 2005的集成 • WSE3.0工具集成到Visual Studio 2005开发环境中 • 扩展了ASMX 的编程模型 • Alternative transports e.g. TCP • Hosting environments e.g. Console apps • Messaging APIs remain • SoapClient, SoapService
目标 Indigo .NET Framework v2.0 WSE v3.0 通向Indigo 简化面向服务的应用的开发 开发安全、功能丰富的 Web Service
Web Services ArchitectureWeb Services Enhancements 3.0 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
安全性是WSE的首要目标 • 支持如下WS-*规范 • WS-Security • WS-Trust • WS-SecureConversation
安全的通讯传输层的安全性 • 发送者必须信任中介 • 消息在中介处需要解密 • 整条信息加密 • 仅能使用有限的传输协议 Encrypted Encrypted
安全的通讯消息级别的安全性 • 与传输层无关的端到端的安全性 • 支持多种加密技术 • 可以加密消息的某一部分 • 发送者只需信任最终的接受者 • The signature is stored with the data
Application Server Turnkey Security ScenarioUsernameOverCertificate Intranet Internet Username/Password for Authentication Confidential, signedrequest using a client keyprotected with theserver certificate Confidential, signedresponse using the supplied client key Authenticate username/ Password
Turnkey Security Scenarios • 基于业界的最佳实践 • Each scenario represented as an assertion • UsernameOverCertificate • AnnonymousOverCertificate • UsernameOverTransport • Kerberos • MutualCertificate
Web Services ArchitectureWeb Services Enhancements 3.0 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
WSE 3.0支持WS-Policy • Describes requirements for incoming and outgoing messages as policy assertions • Limitations of Policy in WSE 2.0 • Request and response messages secured separately • Made to think in low level terms • Policy files are simplified • Simplifies security through the turnkey security assertions • New object model for policy // Set the ClientPolicy onto the proxy serviceProxy.SetPolicy("ClientPolicy");
Service Orientation Tenets • Services are autonomous • Boundaries are explicit • Services share schemas not types • Compatibility based on policy
Security Policy Security is a deployment consideration • Policy • Only accept Username/Password for authentication, signed and encrypted with server certificate • Only callers who are in the Manager role • Policy • Only accept Kerberos • authentication
Policy Pipeline Architecture Policy assertions transform the message Policy describes an input pipeline Input Soap Message Custom Tracing Security Application Processing Output Soap Message Custom Security Tracing … and an output Pipeline
Web Services ArchitectureWeb Services Enhancements 3.0 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
Security Simplify Reduction MTOM • Message Transmission Optimization Mechanism (MTOM) • MTOM取代了对DIME & WS-Attachments • 益处 • 和 WS-Security 可以保护传输的数据 • 简化的变成模型 • 减少消息的大小
Web Services ArchitectureWeb Services Enhancements 3.0 应用和 应用基础设施 Connected Applications BusinessProcess … Management Security Reliability Transactions Metadata 基础 Messaging XML … HTTP TCP SMTP 传输层
Extend ASMX programming Model Example: ASMX Web Service over TCP public class StockServiceSystem.Web.Services.WebService { [WebMethod] public StockQuote[] StockQuoteRequest([string[] symbols) { } } static void Main(string[] args) { Uri to = new Uri( "soap.tcp://StockService/StockQuote"); EndpointReference EPR = new EndpointReference(to); SoapReceivers.Add (EPR, typeof (StockService)); }
Web Services ArchitectureIndigo Web Services Applications & Application Infrastructure BusinessProcess Connected Applications … Management Security Reliability Transactions Metadata Foundation Messaging XML … HTTP TCP SMTP Transports
天下归一 .NET Remoting ASMX 互操作性 跨平台 .NET 与 .NET之间通讯 分布式事务… 消息队列 对WS-*规范的支持 Enterprise Services System.Messaging WSE
ASMX ES WSE3 通向IndigoLeveraging Existing Microsoft Investments • Side-by-side co-existence with existing distributed technologies • Seamless communication with applications built on existing technologies • Smooth upgrade of existing code to Indigo ASMX ASMX
如果开发分布式应用首选Web Service • 如果开发基本的Web Service,使用ASMX • 如果需要支持WS-*,使用WSE3.0 • 开始关注Indigo
http://msdn.microsoft.com/webservices • http://www.microsoft.com/china/msdn/
问题 • 例举WSE3.0中支持的WS-*规范 • 例举SOA的四大特点 • 什么是MTOM