.Net Remoting. 2 Distributed Computing under.Net In.Net, there are three levels of access to distributed computing machinery: In.Net, there are three.

Slides:



Advertisements
Similar presentations
Message Passing Vs Distributed Objects
Advertisements

Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Zoiner Tejada Hershey Technologies. About Zoiner Tejada.
.Net Remoting Pooja Panjala 06/17/10. Agenda What is.net Remoting? Explanation of terms Architecture Implementation of Remoting Sample example.net Security.
C# and Windows Programming Application Domains and Remoting.
.NET REMOTING CertSIG Tom Perkins. FUNDAMENTALS Distributed Applications Process A Process B Process C Objects can communicate across process boundaries.
Remote Procedure CallCS-4513, D-Term Remote Procedure Call CS-4513 Distributed Computing Systems (Slides include materials from Operating System.
.NET Remoting. .Net Remoting Replaces DCOM (Distributed Component Object Model – a proprietary Microsoft technology for communication among software components.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Windows Communication Foundation and Web Services.
1 Advanced Programming Topics - II Objectives:  Background  Remoting  Types of remoting  Marshalling  Farmatters  Channels.
.Net Remoting Jim Fawcett CSE775 – Distributed Objects Spring 2004.
IS 360 Course Introduction. Slide 2 What you will Learn (1) The role of Web servers and clients How to create HTML, XHTML, and HTML 5 pages suitable for.
Distributed Systems Tutorial 2 -.NET Remoting. 2 What is Remoting?  Remoting allows you to pass objects or values across servers in different domains.
.NET Deployment Matt Smouse CSE775 – Distributed Objects Spring 2003.
1 The World Wide Web Architectural Overview Static Web Documents Dynamic Web Documents HTTP – The HyperText Transfer Protocol Performance Enhancements.
Module 1: Overview of the Microsoft.NET Framework.
Definitions, Definitions, Definitions Lead to Understanding.
Distributed Systems Tutorial 3 -.NET Remoting – Crossing Application Boundaries.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
.NET, and Service Gateways Group members: Andre Tran, Priyanka Gangishetty, Irena Mao, Wileen Chiu.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
.NET Remoting Architecture. Slide 2 CITE 4420.NET Remoting Topics Remoting Boundaries Crossing the Boundaries Distributed Applications Marshalling Channels.
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Distributed Communication via ASP.Net Web Services and.Net Remoting By Richard King.
Microsoft ® ASP.NET Presented by Joseph J. Sarna Jr. JJS Systems, LLC.
CSCI 6962: Server-side Design and Programming Web Services.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
Lecture 15 Introduction to Web Services Web Service Applications.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
.Net and Web Services Security CS795. Web Services A web application Does not have a user interface (as a traditional web application); instead, it exposes.
Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs.
DotNet Michelle Johnston, Firebird Services Ltd. What is Dot Net Aims to simplify web development Language independent – CLR (Common Language Runtime)
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Systems Prog. & Script. - Heriot Watt Univ 1 Systems Programming & Scripting Lecture 11: The Distributed Object Model.
Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document.
Key Components of.NET Framework  Common Language Runtime  CLR at Design time  CLR at Runtime  Class Library  Assemblies  Namespaces  ASP.NET  Applications.
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
Intro to Web Services Dr. John P. Abraham UTPA. What are Web Services? Applications execute across multiple computers on a network.  The machine on which.
.NET Mobile Application Development XML Web Services.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
OE-NIK HP Advanced Programming Web services Standards and protocols Using web services Using web services with asynchronous calls.
.NET Remoting. Remoting Introduction The process of programs or components interacting across certain boundaries either different processes or machines.
Jim Fawcett CSE687 – Object Oriented Design Spring 2001
Windows Communication Foundation and Web Services
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Introducing the Microsoft® .NET Framework
Jim Fawcett CSE775 – Distributed Objects Spring 2003
.NET Remoting Priyanka Bharatula.
Using Application Domains Effectively
Presentation 23 .NET Remoting Introduced
Matt Smouse CSE775 – Distributed Objects Spring 2003
Windows Communication Foundation and Web Services
Chapter 9 Web Services: JAX-RPC, WSDL, XML Schema, and SOAP
Student: Popa Andrei-Sebastian
Matt Smouse CSE775 – Distributed Objects Spring 2003
Jim Fawcett Core Technologies Spring 2005
Jim Fawcett CSE791 – Distributed Objects Spring 2002
Message Passing Systems Version 2
Matt Smouse CSE775 – Distributed Objects Spring 2003
Message Passing Systems
Presentation transcript:

.Net Remoting

2 Distributed Computing under.Net In.Net, there are three levels of access to distributed computing machinery: In.Net, there are three levels of access to distributed computing machinery: Low Level: Low Level: System.Net.Sockets System.Net.Sockets Intermediate Level Intermediate Level System.Runtime.InteropSerives System.Runtime.InteropSerives Access COM objects and Win32 API Access COM objects and Win32 API System.Runtime.Remoting System.Runtime.Remoting Access channels and CLR activation Access channels and CLR activation Channels based on TCP or HTTP over TCP Channels based on TCP or HTTP over TCP High Level High Level System.Web.Services System.Web.Services System.Web.UI System.Web.UI

.Net Remoting3 Distributed Computing under.Net System.Net.Sockets System.Net.Sockets Provides low-level access to socket objects Provides low-level access to socket objects You create listeners and send and receive just like we did in CSE691 – Software Modeling and Analysis You create listeners and send and receive just like we did in CSE691 – Software Modeling and Analysis System.Runtime.Remoting System.Runtime.Remoting Provides access at a medium level of abstraction. Provides access at a medium level of abstraction. You create channels and proxies and do RPCs on remote objects You create channels and proxies and do RPCs on remote objects Data marshaling is much richer than under COM. You can send anything the CLR understands as long as it has a [serializable] attribute or derives from MarshalByRef. Data marshaling is much richer than under COM. You can send anything the CLR understands as long as it has a [serializable] attribute or derives from MarshalByRef. Basically you just add those.Net identifiers and the CLR takes care of everything else. Basically you just add those.Net identifiers and the CLR takes care of everything else.

.Net Remoting4 Remoting.Net Libraries System.Runtime.Remoting.Activation System.Runtime.Remoting.Activation Activate remote objects Activate remote objects System.Runtime.Remoting.Channels System.Runtime.Remoting.Channels Sets up channel sinks and sources for remote objects Sets up channel sinks and sources for remote objects System.Runtime.Remoting.Channels.HTTP System.Runtime.Remoting.Channels.HTTP Uses SOAP protocol to communicate with remote objects Uses SOAP protocol to communicate with remote objects System.Runtime.Remoting.Channels.TCP System.Runtime.Remoting.Channels.TCP Uses binary transmission over sockets Uses binary transmission over sockets System.Runtime.Remoting.Contexts System.Runtime.Remoting.Contexts Set threading and security contexts for remoting Set threading and security contexts for remoting System.Runtime.Remoting.Messaging System.Runtime.Remoting.Messaging Classes to handle message passing through message sinks Classes to handle message passing through message sinks System.Runtime.Remoting.Metadata System.Runtime.Remoting.Metadata Customize HTTP SoapAction type output and XML Namespace URL Customize HTTP SoapAction type output and XML Namespace URL System.Runtime.Remoting.Proxies System.Runtime.Remoting.Proxies System.Runtime.Remoting.Services System.Runtime.Remoting.Services

.Net Remoting5 Distributed Computing under.Net System.Web.Services System.Web.Services Servers are hosted under IIS Servers are hosted under IIS Use HTTP-GET and HTTP-POST or higher level SOAP Use HTTP-GET and HTTP-POST or higher level SOAP Simple Object Access Protocol (SOAP) Simple Object Access Protocol (SOAP) Wraps XML message in SOAP envelope (XML tags) Wraps XML message in SOAP envelope (XML tags) SOAP messages are interpreted by IIS and ASP SOAP messages are interpreted by IIS and ASP Typically use standard and/or custom COM components in ASP pages. Typically use standard and/or custom COM components in ASP pages. Active Server Pages (ASP) are XHTML pages with embedded server-side and client-side scripts that may access COM and C# objects for a significant part of their processing. Active Server Pages (ASP) are XHTML pages with embedded server-side and client-side scripts that may access COM and C# objects for a significant part of their processing.

.Net Remoting6 Web Related.Net Libraries System.Web System.Web System.Web.Hosting System.Web.Hosting Communicate with IIS and ISAPI run-time Communicate with IIS and ISAPI run-time System.Web.Mail System.Web.Mail System.Web.Security System.Web.Security cookies, web authentication, Passport cookies, web authentication, Passport System.Web.Services – close ties to ASP.NET System.Web.Services – close ties to ASP.NET System.Web.Services.Description System.Web.Services.Description System.Web.Services.Discovery System.Web.Services.Discovery System.Web.Services.Protocol – raw HTTP and SOAP requests System.Web.Services.Protocol – raw HTTP and SOAP requests System.Web.SessionState – maintain state between page requests System.Web.SessionState – maintain state between page requests System.Web.UI – access to WebForms System.Web.UI – access to WebForms

.Net Remoting7 Remoting Architecture.Net Remoting uses System.Runtime.Remoting.Net Remoting uses System.Runtime.Remoting It is built on processing that supports: It is built on processing that supports: Channels Channels A channel is a socket-based communication mechanism that can use either basic TCP protocol or the higher HTTP layer. A channel is a socket-based communication mechanism that can use either basic TCP protocol or the higher HTTP layer. Activation Activation Activation is basically the same process that the CLR uses to create local objects. Activation is basically the same process that the CLR uses to create local objects. You just have to tell the CLR what object you want. You just have to tell the CLR what object you want. The CLR manages its lifetime and marshals data and references back and forth, using a channel. The CLR manages its lifetime and marshals data and references back and forth, using a channel.

.Net Remoting8 Remoting Architecture

.Net Remoting9 Basic.Net Remoting – Remote Object First create a remote-able object: First create a remote-able object: Design an object to be invoked remotely, derived from MarshalByRef Design an object to be invoked remotely, derived from MarshalByRef Implement the class as a C# library – this creates a dll. Implement the class as a C# library – this creates a dll. Any objects that you need to pass to that object need to be serializable. Any objects that you need to pass to that object need to be serializable. The basic types like ints and strings already are serializable. The basic types like ints and strings already are serializable. Your class objects need to have the [Serializable] attribute and contain only serializable data members. Your class objects need to have the [Serializable] attribute and contain only serializable data members. Or they can derive from MarshalByRef.

.Net Remoting10 Remoting Architecture

.Net Remoting11 Basic.Net Remoting – the Server Create a server: Create a server: Design a C# class, using a C# Console Application, or Empty Project in which you will create a WinForm. Design a C# class, using a C# Console Application, or Empty Project in which you will create a WinForm. In a member function – main will work: In a member function – main will work: Create a TcpServerChannel Create a TcpServerChannel Register the Channel with ChannelServices Register the Channel with ChannelServices Register the type of object clients want to use remotely by calling RegisterWellKnownServiceType Register the type of object clients want to use remotely by calling RegisterWellKnownServiceType Then, block the main thread. Then, block the main thread. The object will be created by the CLR on its own thread and remote clients will access the object through the CLR. The object will be created by the CLR on its own thread and remote clients will access the object through the CLR. You don’t have to write any server code to support this access – the CLR takes care of it for you. You don’t have to write any server code to support this access – the CLR takes care of it for you. Create a reference to the remote-able object’s assembly, build, and run the server. Create a reference to the remote-able object’s assembly, build, and run the server.

.Net Remoting12 Remoting Architecture

.Net Remoting13 Basic.Net Remoting – the Client Create a client: Create a client: Design a C# class, using a C# Console Application, or Empty Project in which you will create a WinForm. Design a C# class, using a C# Console Application, or Empty Project in which you will create a WinForm. In a member function – main will work: In a member function – main will work: Create a TcpServerChannel Create a TcpServerChannel Register the Channel with ChannelServices Register the Channel with ChannelServices In a member function – main will work: In a member function – main will work: Create a proxy to access the remote component. You do this by calling Activator.GetObject(…) and casting the result to the type of the remote object. Create a proxy to access the remote component. You do this by calling Activator.GetObject(…) and casting the result to the type of the remote object. Note that both client and server need the assembly for the remote-able object. Note that both client and server need the assembly for the remote-able object. Then, make calls on the remote object as needed. Then, make calls on the remote object as needed. You simply use the proxy as if it were the real object. You simply use the proxy as if it were the real object. Create a reference to the remote-able object’s assembly, build, and run the client. Create a reference to the remote-able object’s assembly, build, and run the client.

.Net Remoting14 Remoting Architecture

.Net Remoting15 Architecture for Project #3 The previous slides described a classic client/server configuration. The previous slides described a classic client/server configuration. For Project #3 we need something a little more sophisticated. For Project #3 we need something a little more sophisticated. In a classic client/server only the client initiates communication. In a classic client/server only the client initiates communication. In Project #3 you will have to have the “server” make notifications back on the “client”. In Project #3 you will have to have the “server” make notifications back on the “client”. I would create a reply function that works just like the server, described earlier, except that the thread does not block after setting up the channel, but instead returns. I would create a reply function that works just like the server, described earlier, except that the thread does not block after setting up the channel, but instead returns. I would create a request function that works just like the client, described earlier. I would create a request function that works just like the client, described earlier. I would have my Main function call the reply function then, as needed, call the request function. Everything else is just servicing the user interface. I would have my Main function call the reply function then, as needed, call the request function. Everything else is just servicing the user interface. I would do this for both the “client” that subscribes to notifications, and the “server” that sends out directory change notifications. I would do this for both the “client” that subscribes to notifications, and the “server” that sends out directory change notifications.