Скачать презентацию WEB 307 Web Services Deployment Configuration Versioning Скачать презентацию WEB 307 Web Services Deployment Configuration Versioning

ea37d60d50795a2be15f11965715a604.ppt

  • Количество слайдов: 44

WEB 307 Web Services Deployment, Configuration & Versioning Richard Turner Program Manager XML Enterprise WEB 307 Web Services Deployment, Configuration & Versioning Richard Turner Program Manager XML Enterprise Services Microsoft Corporation

Contents Deployment XCOPY MSI Third Party Tools SDC Build & Deployment Tool Publishing Web Contents Deployment XCOPY MSI Third Party Tools SDC Build & Deployment Tool Publishing Web Services Configuration . NET Configuration Config Files DBMS Config Versioning . NET Versioning Web Services Versioning Remoting Versioning Database Versioning

Deployment Distribution of components, content and configuration Essential to keep as an atomic unit Deployment Distribution of components, content and configuration Essential to keep as an atomic unit Automatic deployment is nirvana Several tools / techniques: XCOPY MSI Installer Build-in Visual Studio. NET Setup Projects Third Party tools Domain specific tools Remember to test!

XCOPY Deployment Can be very quick and very simple May require scripting To configure XCOPY Deployment Can be very quick and very simple May require scripting To configure environment To create & configure platform, eg: VRoots Folders Mailboxes IIS doesn’t need to be restarted Great for automated deployments

MSI Based Installations Microsoft Installer technology built into Windows Provides transacted, atomic deployment and MSI Based Installations Microsoft Installer technology built into Windows Provides transacted, atomic deployment and configuration of applications Corrupted installations can be repaired Broad industry support Installation Builders Deployment Tools

VS. NET Setup Projects Visual Studio. NET includes several setup projects: Setup Web Setup VS. NET Setup Projects Visual Studio. NET includes several setup projects: Setup Web Setup Merge Module CAB The Wizard will guide you Great for Quick ‘n’ dirty deployments Moderate levels of control

Third Party Installer Tools Third party tools are an important consideration Packaging & Web Third Party Installer Tools Third party tools are an important consideration Packaging & Web Deployment Install. Shield Wise Zero. G Many tools provide powerful features Scriptable & customizable engine Visual Studio integration Cross-platform support

Deployment Tools Content Management & Delivery Microsoft Content Management Server Vignette Interwoven Deployment Microsoft Deployment Tools Content Management & Delivery Microsoft Content Management Server Vignette Interwoven Deployment Microsoft SMS Tivoli Zero G Altiris Manage. Soft

SDC Build & Deployment Tool Developed by Microsoft’s Solution Development Center Used to build SDC Build & Deployment Tool Developed by Microsoft’s Solution Development Center Used to build significant real-world solutions Combines 3 services: Build, Packaging and Deployment Build: Controlled through an XML makefile Powerful and flexible – can build Windows apps, Websites, Web. Services, etc. Packaging All deployable resources packaged into MSI files

SDC Build & Deployment Tool Deployment engine instantiated by MSI installer and is driven SDC Build & Deployment Tool Deployment engine instantiated by MSI installer and is driven by XML deployment file Supports creation of: IIS VRoots Folders & ACL’s SQL Databases Biz. Talk provisioning Enterprise Services / COM+ Components Windows Services Etc… Support for more technologies on the way

SDC Build & Deployment Tool available publicly at: http: //www. gotdotnet. com/Community/User Samples/Details. aspx? SDC Build & Deployment Tool available publicly at: http: //www. gotdotnet. com/Community/User Samples/Details. aspx? Sample. Guid=2 cb 20 e 79 -d 706 -4706 -9 ea 0 -26188257 ee 7 d Full source code available for your own customization No formal support May need modifications for your needs or environment

Publishing Web Services Who will use your Web Service? How and where will they Publishing Web Services Who will use your Web Service? How and where will they find it? UDDI, WS_Inspection and WSDL can help! Defined by Microsoft, IBM, Ariba and others Submitted to standards bodies for ratification Gaining broad industry support WSDL likely to become the Web Services equivalent of IDL + + + + !!!

Web Service Discovery UDDI Federated Web Services meta-data directory Powerful search & query capabilities Web Service Discovery UDDI Federated Web Services meta-data directory Powerful search & query capabilities Included in Windows 2003 Server Available on many platforms from a number of vendors WSDL Detailed type, interface and protocol spec’s for Web Services Inherent within. NET WS_INSPECTION Enumerate Web Services within a machine / environment Requires implementation at present …

Database Deployment Many ways to deploy Databases Depends on facilities offered by DBMS’ vendor Database Deployment Many ways to deploy Databases Depends on facilities offered by DBMS’ vendor Microsoft SQL Server has a comprehensive range of options: Write your own script in TSQL or SQL-DMO Generate DB Script from existing DB Database export & import wizards (schema + data) Replication Backup and restore elsewhere Detach files and re-attach elsewhere Explore your DBMS’ facilities

Deployment Process Reliable, repeatable deployment can be hard to achieve! Plan your deployment story Deployment Process Reliable, repeatable deployment can be hard to achieve! Plan your deployment story in detail Test several times before final deployment Test again and again … Test on different hardware & environments Effective testing is exponentially more important when upgrading a running system! Plan for when things go wrong Because they usually do!!!!! Practice makes perfect!

Configuration Considering: . NET, ASPX config Platform Data tier Configuration Considering: . NET, ASPX config Platform Data tier

. NET Configuration. NET is configured through XML configuration files: machine. config holds machine-wide . NET Configuration. NET is configured through XML configuration files: machine. config holds machine-wide config settings web. config holds config information for ASP. NET web sites and web services app. exe. config Configuration for. NET applications Config files are manipulated through: Manual intervention Script / code Tools

machine. config Found in: %windir%Microsoft. NETFrameworkv 1. x. yy yyconfigmachine. config Provides a great machine. config Found in: %windir%Microsoft. NETFrameworkv 1. x. yy yyconfigmachine. config Provides a great deal of control over. NET & ASP. NET engine, including: CPU affinity Worker process & thread characteristics Request limits Process user identity

Web Service Configuration Web Services configured via XML web. config file: <? xml version= Web Service Configuration Web Services configured via XML web. config file: Header Footer Configuration Sections (small selection)

Configuring for Availability What happens when your app crashes, hangs or eats the whole Configuring for Availability What happens when your app crashes, hangs or eats the whole machine? For IIS 5. x, consider the element in machine. config Configuring Memory limits, thread limits etc. can help your applications! For IIS 6, use the IIS configuration console is ignored!

Configuring for Security How do you secure your Web Service? Web. config contains key Configuring for Security How do you secure your Web Service? Web. config contains key security settings Authentication methods including: Anonymous, Basic, Windows, Certificate, Kerberos, Forms Authorization for Users & Roles, eg:

Extending Configuration Consider storing app specific config in custom sections: <app. Settings> <add key=“db. Extending Configuration Consider storing app specific config in custom sections: Create a Configuration Section Handler which implements the following interface: namespace System. Web. Configuration { public interface IConfiguration. Section. Handler { public Object Create(Object parent, Object input, Xml. Node node); } }

Data Tier Configuration Most DBMS’ have powerful configuration capabilities Microsoft SQL Server configurable through: Data Tier Configuration Most DBMS’ have powerful configuration capabilities Microsoft SQL Server configurable through: 1170 system Stored Procedures SQL Distributed Management Objects (SQLDMO) Consider implementing a config tool or script for your project: Repeatability is key!

Versioning Goodbye “DLL Hell”! Versioning is inherent to. NET Assembly Versioning Remoting Versioning No Versioning Goodbye “DLL Hell”! Versioning is inherent to. NET Assembly Versioning Remoting Versioning No technological versioning story for Web Services! But there are still ways ; ) Requires careful planning Build versioning into your designs Make careful decisions around encoding etc.

. NET Assembly Versioning. NET versions at the Assembly level Major. minor. build. revision . NET Assembly Versioning. NET versions at the Assembly level Major. minor. build. revision Eg: . NET Frameworks 1. 1 = 1. 1. 4322. 573 All assemblies are version checked by the CLR loader if strongly named Versions can be coerced through config files:

File & Assembly Versioning Files and assemblies can be versioned independently The <Assembly. Version> File & Assembly Versioning Files and assemblies can be versioned independently The attribute defines the assembly’s version that CLR binds against The updates the file version string When should I update version numbers? For pre-ship builds: Keep assembly versions the same between builds, but update the file version info For shipped product: Increment the build only if your new Assembly changes it’s semantics or risks breaking existing code. Otherwise, just rev the revision Only update major or minor when big changes occur Update your version numbers during your build process Try to avoid the “ 1. 2. *” wildcard mechanism … can introduce uncertainty!

Web Service Versioning Web Services do not support full. NET versioning mechanisms externally Since Web Service Versioning Web Services do not support full. NET versioning mechanisms externally Since versioning is not a Web Service technology Key goal is to extend a type over time without breaking existing consumers Several Web Service versioning techniques

Namespace Versioning Implemented through URI’s Date Encoded: http: //foo. org/2003/05/23/Invoice. asmx Version Encoded: http: Namespace Versioning Implemented through URI’s Date Encoded: http: //foo. org/2003/05/23/Invoice. asmx Version Encoded: http: //foo. org/v 2. 0. 4822. 2/Invoice. asmx Familiar to anyone who navigates the W 3 C spec’s Quick, simple and dirty versioning strategy But … plagued by problems: Each new “version” invisible to existing clients without redirection Even with redirection, existing clients validate messages against XSD which is now different New namespace != new version New namespace == new elements & types Recommend Namespace Versioning not be used … unless you can accept breaking downlevel clients

So what do I do? Bear with us we’re working on solving this in So what do I do? Bear with us we’re working on solving this in the future ; ) Until then, there are several versioning techniques: Loosely typed fields Optional elements User parsed datatypes Essentially, consider making your web services version-flexible! Requires that you learn to l ve XSD!

Loosely Typed Fields Specify methods accepting parameters of “object” type public string Add. Sale( Loosely Typed Fields Specify methods accepting parameters of “object” type public string Add. Sale( [Xml. Element(Namespace="http: //sales")] object sale) {. . . } Map these properties to XSD elements Up to the application to then parse the data accordingly The parameters’ data is not implicitly validated against schema

Optional Elements Useful when extending existing types Does not break existing consumers Inherently validated Optional Elements Useful when extending existing types Does not break existing consumers Inherently validated against XSD Eg, V 1: [Xml. Type(Namespace="http: //people")] public class Sale { public string customer. Name; }

" src="https://present5.com/presentation/ea37d60d50795a2be15f11965715a604/image-32.jpg" alt="Optional Elements (cont…) V 2: " /> Optional Elements (cont…) V 2: Serializer sees that this field exists and sets this to true V 2 aware code reads this and acts accordingly [Xml. Type(Namespace="http: //people")] public class Person V 2 aware code sets { this … public string customer. Name; public int item. Count; [Xml. Ignore()] public bool item. Count. Specified; } … and the serializer writes this

Open Content Types Consider Open Content Model for types that are highly dynamic in Open Content Types Consider Open Content Model for types that are highly dynamic in structure Can still specify structured elements within such structures Use property bags for open extensibility

Open Content Usage When deserialized, elements that do not exist as fields in the Open Content Usage When deserialized, elements that do not exist as fields in the object are collected into an array which can be processed accordingly … // Deserialize the class. Object x = my. Serializer. Deserialize(fs); // Read the element names and values. foreach(Xml. Element xel in x. All. Elements) Console. Write. Line(xel. Local. Name + ": " + xel. Value); …

Open Content Versioning Use the “version” tag defined in the schema to make versioning Open Content Versioning Use the “version” tag defined in the schema to make versioning decisions public string Add. Sale ([Xml. Element(Namespace="http: //sales")] Sale sale) { switch (sale. version) { case "1. 0": return Do. Add. Sale(sale); default: return Do. Add. Sale. V 2(sale); } } VERY loosely typed, but still as type-safe as can be!!

Versioning & Remoting Server Activated Objects (SAO): Server controls which version is activated If Versioning & Remoting Server Activated Objects (SAO): Server controls which version is activated If no version info sent from client, latest version is instantiated Version can be coerced via config file:

More remoting & versioning Object references follow the same rules as for SAO’s and More remoting & versioning Object references follow the same rules as for SAO’s and CAO’s The object reference carries version info, but the previous rules are maintained Object Marshalled By Value (MBV) only includes version info if: Binary. Formatter is used Soap. Formatter + config declaration is specified:

Database Versioning This is VERY hard to do! Usually involves a data manipulation and Database Versioning This is VERY hard to do! Usually involves a data manipulation and migration process Customizing a replicated version at a point in time is a good solution Requires EXTENSIVE testing Expect (& plan for) downtime Often requires duplicate hardware rig Avoid if possible through careful DB design at the outset!

Suggested Reading And Resources The tools you need to put technology to work! TITLE Suggested Reading And Resources The tools you need to put technology to work! TITLE Available Price Building XML Web Services for the Microsoft. NET Platform Today $59. 99 Scott Short l l Visit the Microsoft Press Kiosk today to receive 40% off books purchased from Amazon. com Microsoft Press books are available at the Tech. Ed Bookstore and also at the Ask the Experts area in the Expo Hall

Additional Reading And Resources The tools you need to put technology to work! TITLE. Additional Reading And Resources The tools you need to put technology to work! TITLE. NET Web Services: Architecture and Implementation with. NET Available Price Today $49. 99 Keith Ballinger Essential. NET, Volume I: The Common Language Runtime Don Box

Community Resources http: //www. microsoft. com/communities/default. mspx Most Valuable Professional (MVP) http: //www. mvp. Community Resources http: //www. microsoft. com/communities/default. mspx Most Valuable Professional (MVP) http: //www. mvp. support. microsoft. com/ Newsgroups Converse online with Microsoft Newsgroups, including Worldwide http: //www. microsoft. com/communities/newsgroups/default. mspx User Groups Meet and learn with your peers http: //www. microsoft. com/communities/usergroups/default. mspx

evaluations evaluations

Conclusion There is no single silver bullet today for versioning or deployment But we’re Conclusion There is no single silver bullet today for versioning or deployment But we’re working on it ; ) Consider a toolset that suits your needs. NET Provides very powerful deployment, configuration & versioning facilities But plan carefully Aim for automation – helps ensure reliable & repeatable deployments Test test and test again! And when you think you’ve tested enough … … Test again, just to make sure

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. © 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.