140 likes | 277 Views
Distributed Communication via ASP.Net Web Services and .Net Remoting. By Richard King. What are ASP.Net Web Services and .Net Remoting?. Two new technologies provided in the .Net Framework for developing distributed applications. ASP.Net Web Services and .Net Remoting replace:
E N D
Distributed Communication via ASP.Net Web Services and .Net Remoting By Richard King
What are ASP.Net Web Services and .Net Remoting? • Two new technologies provided in the .Net Framework for developing distributed applications. • ASP.Net Web Services and .Net Remoting replace: • Microsoft’s DCOM (Distributed Component Object Model) • Java RMI (Remote Machine Invocation) • CORBA (Common Object Request Broker Architecture)
Definitions • ASP.Net Web Services: provides a simple API (Application Programming Interface) for Web services based on mapping SOAP (Simple Object Access Protocol) messages to method invocations. • .Net Remoting: provides an infrastructure for distributed objects. It exposes the full-object semantics of .NET to remote processes using plumbing that is both very flexible and extensible.
.Net Remoting • A tight coupled client and server approach to distributed communication. • Supports the communication of a full feature set of data types. • .Net Remoting has support for passing objects by value or by reference, callbacks, and multiple-object activation and lifecycle management policies. • Similar to Java’s RMI.
ASP.Net Web Services • Works by exposing APIs called web methods via HTTP. • Web Methods provide a service to the end user. • Enables cross platform integration using XML, HTTP and SOAP. • Using industry standards makes Web Services independent of programming languages and platforms.
ASP.Net Web Services Cont… • WSDL (Web Service Discription Language): exposes web methods, protocols supported, signatures of methods and web service location. • DISCO (short for discovery): Microsoft technology for publishing and discovering web services. • UDDI (Universal Description and Discovery Integration): specification for building distributed databases that provide parties a way to “discover” web services.
ASP.Net Web Services and .Net Remoting Compared. • Protocol: • ASP.Net Web Services only provides access via HTTP. Data is formatted in a SOAP packets. • .Net Remoting provides access via TCP, HTTP and custom protocols. Data can be formatted as binary or SOAP packets.
ASP.Net Web Services and .Net Remoting Compared Cont… • States: • ASP.Net Web Services is a stateless environment. • .Net Remoting can be a stateful and stateless environment. • Client Activation • Under the control of lease-based lifetime manager. • Lease-times ensure that the objects are garbage collected when the lease time expires. Lease-times are set by extending the MarshalByRefObject class and implementing the ILease interface inside of MarshalByRefObject . • Server Activation • Stateless mode • SingleCall: creates a new instance of the remoting object for each request. • Stateful mode • Singleton: creates only one instance of an object that is used for all requests.
ASP.Net Web Services and .Net Remoting Compared Cont… • Interoperability: • ASP.Net Web Services works with industry standards to provide high levels of interoperability. This allows for ASP.Net Web Services to work in a heterogeneous environments. • .Net Remoting supplies a tightly coupled form of distributed communication. Clients must be implement with the .Net Framework. The tight coupling causes .Net Remoting to be implemented in a homogeneous environment.
ASP.Net Web Services and .Net Remoting within the .Net Framework
Sample ASP.Net Web Service • using System; • using System.Collections; • using System.ComponentModel; • using System.Data; • using System.Diagnostics; • using System.Web; • using System.Web.Services; • namespace Example • { • public class Example: System.Web.Services.WebService • { • [WebMethod] • public String SayHello() • { • return "Hello"; • } • } • }
Future of Distributed Computing and .Net Framework 2.0 • .Net Remoting will transfer to Indigo Services. • Indigo services will allow for the transfer of objects without sharing .Net assemblies.