Title: Distributed Computing Present Microsoft Solutions
1Distributed 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
2The .NET Framework
Visual Studio.NET
Common Language Specification
ADO.NET and XML
Base Class Library
Common Language Runtime
Operating System
3Unified programming models
4What 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
6The .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
7The .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
System.Collections ArrayList,bitArray,Dictionary,Hashtable, Queue, SortedList, Stack etc.
System.Globalization Calendar,NumberFormatInfo, RegionInfo etc..
System.Net WebRequest,WebResponse,TopClient,TcpListener,UdpClient,Sockets etc.
System.Reflection Assembly, ConstructorInfo, FieldInfo, MemberInfo etc.
System.Web.UI.WebControls AdRotator, BorderStyle, DataGrid, Hyperlink, ListBox etc.,
System.WinForms Button, Checkbox, Form, ListBox etc.,
System.Drawing.Design BitMapEditor, DrawingToolboxItem, FontEditor
9Personal 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
11MS .NET Distributed Applications Model
- Intranet model
- .NET Remoting
- .NET to .NET
- Internet model
- Web services
- HTTP to HTTP
- Ad hoc services for .NET clients
12MS .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
13MS .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
14MS .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
15MS .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 allows the
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
16MS .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
17MS .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
18MS .NET MarshalByRef
Server
Client
Object
Proxy
Stub
Proxy
Stub
Object, method, and params
Return values
AppDomain
AppDomain
19MS .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
20MS .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
21MS .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.
22MS .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.
23MS .NET TLBIMP vs. Direct Reference
- Tlbimp.exe
- Tlbimp MyCOM.DLL /outNetMyCOM.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.
24MS .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
25MS .NET Microsoft Distribution PatternsKey
degrees of freedom when distributing components
Business Components
Rich Clients
Data Sources
Web UI Farms
Web-based users
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
26Web 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
27Key Benefits of Web Services
- Software as a service
- Dynamic Business Interoperability
- Accessibility
- Efficiency
- Universally Agreed Specifications
- New Market Opportunities
28Service-Oriented Architecture
Service Provider
Publish
Bind
Service Broker
Service User
Find
29Web 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
30Web Services Stack
UDDI
WSDL
SOAP
XML
31Web Service Architecture
Service Provider
Interactions SOAP
Data XML
Communication HTTP
Publish UDDI
Bind SOAP
Service Broker
Service User
UDDI/WSDL Find
32Web 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)
33Web 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)
34Infrastructure Elements
- Directories central location to locate Web
Services provided by other organizations (e.g.
UDDI registry) - Discovery locating WSDL for a particular Web
Service - Description defines what interactions the Web
Service supports - Wire Formats enable universal communication
(e.g. SOAP)
35Application development using Web services
American Forests
Projection Service
36What 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
37Current SOAPs History
- SOAP 1.1 specifications
- Implementations
- MS SOAP Toolkit 2.0
- Apache SOAP 2.2 ? AXIS ( SOAP 3.0)
- SOAPLite 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/
38SOAP (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
39Sample SOAP request
- POST /CurrencyServer/CurrencyExchange.asmx
HTTP/1.1 - Host theseus
- Content-Type text/xml charsetutf-8
- Content-Length length
- SOAPAction http//di.unipi.it/webservices/Euro
- lt?xml version"1.0" encoding"utf-8"?gt
- ltsoapEnvelope
- xmlnsxsihttp//www.w3.org/2001/XMLSchema-insta
nce - xmlnsxsdhttp//www.w3.org/2001/XMLSchema
- xmlnssoaphttp//schemas.xmlsoap.org/soap/envel
opegt - ltsoapBodygt
- ltEuro xmlnshttp//di.unipi.it/webservicesgt
- ltcurrencygtstringlt/currencygt
- lt/Eurogt
- lt/soapBodygt
- lt/soapEnvelopegt
40Sample SOAP reply
- HTTP/1.1 200 OK
- Content-Type text/xml charsetutf-8
- Content-Length length
- lt?xml version"1.0" encoding"utf-8"?gt
- ltsoapEnvelope
- xmlnsxsihttp//www.w3.org/2001/XMLSchema-inst
ance - xmlnsxsdhttp//www.w3.org/2001/XMLSchema
- xmlnssoaphttp//schemas.xmlsoap.org/soap/enve
lopegt - ltsoapBodygt
- ltEuroResponse xmlnshttp//di.unipi.it/webservic
esgt - ltEuroResultgtdoublelt/EuroResultgt
- lt/EuroResponsegt
- lt/soapBodygt
- lt/soapEnvelopegt
41Architecture 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
42Processing 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
43Server-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
44Reflection 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
45WSDL Structure
Types Data type definitions
Message Signature of request and reply for each method ( IDL)
Port Type ltservice, protocolgt ? operations
Operation method ? messages
Binding Protocol and data-format specification
Service Port ? binding
Port Address ( URL)
46WSDL example
- Currency Exchange Service
- Methods
- double Rate(String From, String To)
- double Euro(String Currency)
- Service URL
- http//theseus/CurrencyServer/CurrencyExchange.asm
x
47Building 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
48Building A Server
- lt_at_ WebService classclass" gt
- 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
49Transition 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
50Architecture
Service Broker
inquire
publish
Internet
Service Requester
Service Provider
bind
51Creating Web Service Clients
- Grab WSDL from Web Service
- Create proxy from WSDL
- Execute methods against proxy, passing input
parameters - Proxy calls Web Service on your behalf
- Web Service returns results to proxy
- Retrieve results from proxy
- Display results
52ASP.NET Client
- Uses proxy and SOAP protocol to communicate with
Web Service - Steps
- Use wsdl utility to create local proxy
- Compile proxy using vbc or csc
- Place compiled proxy assembly in bin folder of
Web - Create client
- Import proxy namespace, code to proxys
properties and methods
53Using SOAP toolkit (no .NET)
- // allocate a new SoapClient pointer
- m_pClient new ISOAPClient
- // create the SoapClient pointer
- m_pClient-gtCreateDispatch("MSSOAP.SoapClient")
- // initialize it
- m_pClient-gtmssoapinit ("http//www.MyService.com/S
oapSamples/CalcVB.wsdl", "CalcVB",
"CalcVBPortType", NULL) - // perform addition
- double ISOAPClientAdd(double dblA, double dblB,
DISPID dispid) -
- double result
- static BYTE parms VTS_R8 VTS_R8
- InvokeHelper(dispid, DISPATCH_METHOD, VT_R8,
(void)result, parms, dblA, dblB) - return result
-
54Client Side?
- Use HTTP GET
- handle XML yourself
- Use wsdl.exe, generate client-side program,
invoke it through Jscript - Use ActiveX or Java
55Deployment Scenario
DJInterpool
Customer performs title search
DeadVinyl
Music Portal
Service Broker
Services respond with search results
Portal invokes search Web Service
Service Broker invokes search services
56Two-Way Web
57Current Web Limitations
- Thin but weak
- Not real-time
- Not productive
- Not interactive
- Client cannot initiate actions
- Browser pull waste bandwidth
- Java, ActiveX maintainability and security
restrictions
58Fitting the Pieces
- ER Metamodel
- DB Creation
- DB Loading
- Rules
UML Unified Modeling Language
CWM Common Warehouse Metamodel
XMI XML Metadata Interchange
XML eXtensible Markup Language
DTDs
Schemas
XML Valuetype
Transformation Rules
Instances (doc)
IDL Interface Definition Language
MOF Meta Object Facility
59Applying to Verticals
- The opportunity is to
- reuse design deployment artifacts
- document interface semantics
- support multiple platforms, languages, networks
60Conclusions
- Web Services are quite promising
- Still missing
- some plumbing, interoperability
- 2-way interactivity
- unified multistage programming
- Issues
- no more DLL Hell
- but maybe, Namespace Hell
61Distributed ComputingFuture Research Microsoft
Solutions
- Microsoft Shared Source CLI
- Web services are becoming fundamental building
blocks in the move to distributed computing - Thanks,
- D Garg