1 / 61

Distributed Computing Present Microsoft Solutions

Distributed Computing Present Microsoft Solutions. MS .NET Introduction Architecture Implementation Current Issues Future work Web Services Introduction Service-Oriented Architecture Web Service Architecture Implementation Current Issues Future work SOAP Introduction

roy
Télécharger la présentation

Distributed Computing Present Microsoft Solutions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Computing Present Microsoft Solutions • MS .NET • Introduction • Architecture • Implementation • Current Issues • Future work • Web Services • Introduction • Service-Oriented Architecture • Web Service Architecture • Implementation • Current Issues • Future work • SOAP • Introduction • Architecture • Implementation • Current Issues • Future work • Real World Implementation

  2. VB C++ C# JScript … ASP.NET Web Forms Web Services Mobile Internet Toolkit Windows Forms The .NET Framework Visual Studio.NET Common Language Specification ADO.NET and XML Base Class Library Common Language Runtime Operating System

  3. Consistent API availability regardless of language and programming model .NET Framework RAD, Composition, Delegation Subclassing, Power, Expressiveness Server based, Stateless, Projected UI ASP VB Forms MFC/ATL Windows API Unified programming models

  4. What is .NET? • Microsoft development tool and distributed computing framework • A software platform for XML Web Services • Built with heavy emphasis on the creation of Web Services • Common Language Runtime • Unified programming classes • ASP.NET

  5. .NET Interoperability • PROVIDED • There is conformance to the Virtual Object System (VOS) object model • There is conformance to the Common Language System(CLS) • THEN • Cross-language inheritance is possible • No need to write wrappers, or IDL • N.B. This will impact on our understanding of information-hiding interfaces for components!!! • Cross-language debugging in Visual Studio.NETtm • Cross-language exceptions • BUT • Not possible for many non-OO languages • Features like overloading are difficult issues • Multiple-inheritance not supported

  6. The .NET Challenge • .NET is Microsoft's new development platform • Announced in 1999 • First products in 2000 • Designed to REPLACE COM+ • Throws away the “binary component” model • Permits programmer customisations • Rewrites DNA • Targets web services • i.e., the Java market • Permits mixing of form and content in language-neutral way • Radically challenges the idea of components as “interface + implementation” which was common to all prior CEEs

  7. The .NET framework Web Services .NET platform, Visual Studio.NET, C# etc., Interchange, persistence ADO+, XML, SOAP Reusable Components Common libraries, Frameworks, ‘# components’ Common Language Runtime

  8. .NET Library Examples

  9. Personal Remarks • .NET provides plumbing for interesting new developments • Opportunity for experimenting with new programming languages • We can start asking questions: • what new higher-level facilities can be designed • how can we contribute: improvements, extensions, applications • Not PDC Questions: • when it will be available? • Will it have this feature?

  10. .NET : Role of CLR and Reflection • Role of CLR Robustness • more and more programs run on server • avoid memory leaks Simplifies programming • Avoid burden of reference counting Reduce incompatibilities • Objects are remotely accessible • More easily reproduced if built on same basic elements • Reflection Avoids IDL • Slight incompatibilities in CORBA Avoids type libraries Provides for dynamic invocation Allows customization • e.g. serialization

  11. MS .NET : Distributed Applications Model • Intranet model • .NET Remoting • .NET to .NET • Internet model • Web services • HTTP to HTTP • Ad hoc services for .NET clients

  12. MS .NET Remoting • Set of services that enable applications to communicate • Applications can reside on the same computer • On different computers in the same LAN • Across the world in "very" different networks and running on heterogeneous platforms • Enable communication between objects in different AppDomains or processes • Different transportation protocols • Different serialization formats • Object lifetime schemes • Modes of object creation

  13. MS .NET : CLR Host • The CLR provides an execution environment for code with services like garbage collection, security, language-neutrality... • Today, .NET executables require a piece of code to start the CLR up and running • exe stub, ASP.NET ISAPI, IE 5.01+, Yukon • In order to run managed code, the CLR Host must obtain a pointer to an entity called app-domain • Normally, it is the default domain within the process • Can create extra domains in the process

  14. Creates a CLR host and inject code in the default domain dotnet.exe Unmanaged Stub CLR Host Default AppDomain Isolation Managed Code Others domains MS .NET : AppDomains • Managed code runs in an application domain • AppDomains are separate units of processing that the CLR recognizes in a running process • AppDomains are separated from one another • Similar to process boundaries but more lightweight

  15. MS .NET : Isolation • Managed code must get through a verification process before it can be run • Code that passedd the test is said to be type-safe • The certainty to run type-safe code allowsthe CLR to provide a level of isolation as strong as the process boundary, but more cost-effective • The CLR enforces isolation by preventing direct calls between objects in different AppDomains • .NET Remoting refers to the set of system services to access objects between domains

  16. Other AppDomains Other AppDomains MS .NET : Remoting and AppDomains .NET Executable .NET Executable Stub Stub Instantiates the CLR host and inject code in the default AppDomain Instantiates the CLR host and inject code in the default AppDomain Process primary thread Process primary thread Remoting (local or remote machine) Default AppDomain Default AppDomain Remoting Remoting

  17. MS .NET : Marshaling • Marshal by value • Object is instantiated on the client and filled with data coming from the server • State of the object downloaded • Marshal by reference • The object lives on the server and any calls take place remotely • Input parameters and return value travel over the network

  18. MS .NET : MarshalByRef Server Client Object Stub Proxy Stub Proxy Object, method, and params Return values AppDomain AppDomain

  19. MS .NET : Remote Components • Class derived from MarshalByRef • Public methods • Work with serializable classes • Application Host • IIS, NT service, custom app • Requires manual activation • Publish your components

  20. MS .NET : Client Applications • Need a reference to the server component • Mark the remote type as "well-known" • Tell the run-time the type lives remotely • JIT compiler adds code on-the-fly to transform local calls into remote calls • Everything happens transparently • Instantiated through operator new

  21. MS .NET : COM & .Net • COM components must be registered prior to use with .Net applications (regsvr32.exe). • .Net Assemblies must be registered for use with COM components (regasm.exe) • Regasm.exe must be run in VS.Net Command Prompt window.

  22. MS .NET : COM & .Net Interoperability • RCW: Runtime Callable Wrappers (INTEROP.COMLib) • DLLHost.exe: host process for handling remote COM calls. • TlbImp.exe: Converts COM to .Net Assembly.

  23. MS .NET : TLBIMP vs. Direct Reference • Tlbimp.exe • Tlbimp MyCOM.DLL /out:NetMyCOM.DLL (execute in VS CMD) • Allows for signing the resulting assembly. • Resulting code can be used in GAC • Direct Reference • Easier to use • Does not allow for signing the assembly • Resulting code cannot be placed in GAC or shared with other .Net assemblies.

  24. MS .NET : Dynamic Objects (.NET) • Dynamic class creation • Dynamic class loading • Needed for interactive SQL interpreter Other .NET Wire-Protocols HTTP GET • HTTP POST • SMTP • … customized

  25. MS .NET : Microsoft Distribution PatternsKey degrees of freedom when distributing components Rich Clients Business Components Data Sources Web-based users Web UI Farms Internal Services Process Orchestration Service Ifaces & Agents Should Biz Components be co-located with Web Components? Should Biz Components / BTS be co-located with Service interfaces and agents? Services Deploy BizTalk clusters separately

  26. Web Service: Definitions & Properties • Component for Web Programming • Self-contained, self-describing, modular component that can be published, located, and invoked across the Web • can be used either internally or exposed externally over the Internet • accessible through a standard interface • allows heterogeneous systems to work together as a single web of computation Properties • Loosely coupled • Ubiquitous communication • Universal data format

  27. Key Benefits of Web Services • Software as a service • Dynamic Business Interoperability • Accessibility • Efficiency • Universally Agreed Specifications • New Market Opportunities

  28. Service-Oriented Architecture Service Provider Publish Bind Service Broker Service User Find

  29. Web Service Scenario • Provider builds and defines the service in WSDL • Provider registers the service in UDDI • User finds the service by searching UDDI registry • User application binds to the Web service and invokes its operations via SOAP

  30. Web Services Stack UDDI WSDL SOAP XML

  31. Web Service Architecture Service Provider Interactions: SOAP Data: XML Communication: HTTP Bind SOAP Publish UDDI Service Broker Service User UDDI/WSDL Find

  32. Discovery Find a Service How do we talk? (WSDL) Web Service Consumer UDDI Web Service Let me talk to you (SOAP) Web Services Protocols http://www.uddi.org Link to discovery document http://yourservice.com HTML with link to WSDL http://yourservice.com/?WSDL return service descriptions (XML) http://yourservice.com/svc1 return service response (XML)

  33. Web Services Infrastructure • Web services encompass a vision of a fully integrated computing network • Requirements for realization • Physical Medium (The Internet) • Self-describing (WSDL and UDDI) • Common Language (XML) • Internet Protocol (SOAP)

  34. Infrastructure Elements Directoriescentral location to locate Web Services provided by other organizations (e.g. UDDI registry) Discovery locating WSDL for a particular Web Service Descriptiondefines what interactions the Web Service supports Wire Formatsenable universal communication (e.g. SOAP)

  35. MD VA DC CBP FWS GIS Coverages WQ Data Habitat Indices USGS Application development using Web services American Forests Projection Service

  36. What Web services mean for Software Development • Faster development • Can use any modern programming language • Do not need to duplicate code or data • Integration • Removes barriers for data sharing and software integration • Benefits within an organization and with partners • Took Kits

  37. Current SOAPs & History • SOAP 1.1 specifications • Implementations: • MS SOAP Toolkit 2.0 • Apache SOAP 2.2  AXIS (= SOAP 3.0) • SOAP::Lite For Perl • pocketSOAP • Apache and MS are working on incompatibilities History • SOAP 0: Developed by UserLand,Microsoft, and DevelopMentor in 1998 • SOAP 1.0 in 2000 • W3C (World Wide Web Consortium) • v1.1 final – May 2000 • W3C v1.2 draft – July 2001 • Specification can be found at: • http://www.w3.org/TR/soap12/

  38. SOAP (Simple Object Application Protocol) Wire-protocol based on XML and HTTP that consists of: • an envelope for describing what is in a message and how to process it • a set of encoding rules for expressing instances of application-defined data types • a convention for representing remote procedure calls and responses

  39. Sample SOAP request POST /CurrencyServer/CurrencyExchange.asmx HTTP/1.1 Host: theseus Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: http://di.unipi.it/webservices/Euro <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:soap=http://schemas.xmlsoap.org/soap/envelope> <soap:Body> <Euro xmlns=http://di.unipi.it/webservices> <currency>string</currency> </Euro> </soap:Body> </soap:Envelope>

  40. Sample SOAP reply HTTP/1.1 200 OK Content-Type: text/xml; charset=utf-8 Content-Length: length <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:soap=http://schemas.xmlsoap.org/soap/envelope> <soap:Body> <EuroResponse xmlns=http://di.unipi.it/webservices> <EuroResult>double</EuroResult> </EuroResponse> </soap:Body> </soap:Envelope>

  41. Architecture using SOAPThe Complete Picture Service BrokerUDDI Registry inquire serviceusing UDDI APIvia SOAP publish serviceusing UDDI APIvia SOAP Internet Service Requester Service Provider bind to Servicevia WSDLusing SOAP

  42. Processing inside SOAP Client WSDL WSML WSDLReader load() WSDLOperation object GetOperationParts() Num. 3 Add(3, 4) Num. 4 Serializer SOAP Connector SOAP request Num. 7 Sum SOAP reply Reader

  43. Server-side SOAP WSDL WSML SoapReader load() WSDLReader ParseRequest | load() SOAP request WSDLOperation object ExecuteOperation | GetOperationParts() Num. 3 Add(3, 4) Num. 4 Num. 7 SOAP reply Serializer Sum

  44. Reflection in Web Services • SOAP proxy performs: • Invoke(m, new object[] {arg1, arg2}); • SOAP message dispatcher: • parses request • creates parameter objects • determines object requested • instantiates object • gets requested method • invokes method with built parameters

  45. WSDL Structure

  46. WSDL example • Currency Exchange Service • Methods double Rate(String From, String To) double Euro(String Currency) • Service URL http://theseus/CurrencyServer/CurrencyExchange.asmx

  47. Building A Server & Trust • Simplicity • Source file (plain text = notepad accessible) • Compiled at run-time similar to ASP.NET pages • Just hit save • File extension is .asmx • File can be inline or in separate assembly Building Trust • CLR exposes its elements • Users can create elements directly • Even when using tools, you can look at their output and change it

  48. Building A Server • <%@ WebService class=“[class]" %> • Names the class and/or language used • using System.Web.Services; • Required namespace • [WebMethod] • Method is ‘web callable’ • Optional: WebService base class • Access ASP.NET intrinsics

  49. Transition to aWeb Services Environment Web Server(NetBuddy 4.0 Information Server) Any client Data and control exchangedusing XML inside SOAP wrappers Web ServicesClient Interface Web ServicesServer Interface World Mail ServicesDirectory (UDDI) Setup, billing,service descriptionusing WSDL Web Services Setup

  50. Architecture Service Broker inquire publish Internet Service Requester Service Provider bind

More Related