SlideShare une entreprise Scribd logo
1  sur  24
.Net Remoting
Distributed Application
                                                         Remote
Distributed systems are                                  Service
                                                           Remote
generally more scalable , more                             Service
robust and increase availability
of services                                Client Requests
                                           remote process
 Common distributed
 protocols are:
 RPC : Remote
 Procedure Calls                                        Server runs the
 DCOM : MS Distributed                                  Service/process and
 Object Model                                           returns the result
 CORBA : Common
 Object Request Broker
 Architecture                  Client
 RMI : Java Remote
 Invocation



      Not Secure for                                 Remote
    external networks                                Service
Distributed Application
 Remote                                                   Remote
 Objects                                                  Objects




                                                         Communication
.Net Remoting allows                                     Channel
access to objects                   Application
placed around a                       Domain
network.It has:                     (Assembly)
•Communication channel
•A formatter : This can be             Local
Binary encoded or XML                 Objects
encoded (SOAP)




                                                       Remote
                                                       Objects
Communication Channel




                     Communication
                        Channel

Application
  Domain
(Assembly)           Formatter: Binary
                                           Remote
                      Fast but not as
                                           Objects
                    compatible as XML
  Local
 Objects
                           Remote
                           Objects

                      Formatter: XML
                           (SOAP)
                   Highly compatible but
                         not as fast
Remoting Overview




Application
  Domain
(Assembly)

  Local
  Object




                                                  Remote
                                                  Object

      Different Assemblies are
      used between Local and
           remote Service               Typically dll
Remote object lifetime




Application
  Domain
(Assembly)

   Local
  Service




                                              Remote
                                              Service


                                       Does the object
                                          persists?
Local Objects

                           Application
                             Domain
                           (Assembly)
           Application
                               Public void myObject (myObjectClass obj)
Pass By Value                  {
                               }
  Local
  Object


       Pass By Reference
                                 Public void myObject (ref myObjectClass obj)
           Local                 {
           Object                }




                                              Within Local
                                               Assembly
Remote Object System




Application
  Domain
(Assembly)

  Local
  Object

                                        Remote
 Serialize                Desterilize   Object




Encapsulate   Formatter   Decapsulate
  (SOAP)      (Encoder)     (SOAP)




Communicate               Communicate
Remote Object Activation
                                  Client activated objects
                                  These have a finite lease time , Once their lease
                                  time expires they are left for garbage collector.
                                  Each caller would get their copy of the object




        Application                                         Remote
                                                            Object


Server Activated Object                         Namespace used for remoting:
                                                System.Net :This include classes
Singleton :All clients get the same
                                                related to the networking elements
instance of the server object. It can           of the distributed system
communicate with multiple clients . Life        System.Runtime.Remoting : This
time is determined by lease based               includes classes for the remote
lifetime (Used for chats, community             aspects of the .NET framework , such
networks)                                       as mechanism for remote
Single Call :Is a type of object activation     communication between objects
when object is discarded immediately            System.Web.Services :This includes
after use. It is stateless.                     protocols relating to Web services
                                                such as those to HTTP and SOAP
                                                encapsulation
Client application domain         Marshaling           Server application domain



                 Local      Objects passed by reference
                            or value for local objects .    Remote
                 Object                                     Object
                            For remote it is not possible
                            to pass by reference –
                            Remote objects must be
        Client object       marshaled

                                                             Server Object


           Proxy




      Remoting System             Communication
                                                            Remoting System
                                     Channel


                                   Serialization
Client application domain         Marshaling           Server application domain


                  Remote Object
                      Local
 public class ShowCapital : MarshalByRefObject              Remote
 {                   Object                                 Object
    public ShowCapital()
    {
    }
          Client object
    public string show ( string country)
    {
aCountry                capital
    }
 }                                           Creates dll
              Proxy                          on server            ShowCapital()


                                                       aCountry                   capital



       Remoting System            Communication
                                                           Remoting System
                                     Channel


                                   Serialization
Client application domain            Marshaling       Server application domain


                                                        Remote
                      Local                             Object
                      Object                           Object.dll
                                      Access public
                                       methods of
                                     remotable obj
           Client object

aCountr                    capital
y

              Proxy                                             ShowCapital()


                                                      aountry                   capital



          Remoting System            Communication
                                                          Remoting System
                                        Channel


                                      Serialisation
Client application domain        Marshaling         Server application domain


                                                          Remote
                   Local                                  Object
                   Object                                Object.dll



        Client object       We need object invocation.
                            And channel configuration.
                            Eg. TCP channel 1234 ,
                            firewalls should allow
           Proxy            channel                            ShowCapital()




      Remoting System           Communication
                                                           Remoting System
                                   Channel


                                  Serialisation
Channels
• TCP Channel – Faster and more secure
  communication. Intended predominantly
  for intra-domain communication.
  Requires port activation for
  communication with external world
• HTTP Channel performed using
  HTTP/SOAP protocol. Good for external
  communication since it is implemented
  over HTTP/HTTPS and most firewalls allow
  HTTP calls through.
Client application domain    TCP Channel

                            Using System.Runtime.Remoting.Channel.Http
                            Using System.Runtime.Remoting.Channel.Tcp
                   Local
                   Object
                            TcpChannel channel = new TcpChannel(1234)

                            ChannelServices.RegisterChannel(channel)
        Client object

                                             Makes sure channel is not used
                                             by other apps
           Proxy

                               Channel=1234



      Remoting System        Communication
                                Channel



                               Server activation object
Client application domain       Activation          Server application domain


                                                       Remote
                                                       Object
                                                      Object.dll

                            Channels map onto TCP
                            ports..
        Client object       Standard ports are:
                            21-FTP
                            23-TELNET
                            56-DNS
           Proxy            80-www                         ShowCapital()
                            110-POP 3
                            >1024 : developer use



      Remoting System          Communication
                                                        Remoting System
                                  Channel


                                 Serialisation
Client application domain   Activation


                            Server Activation is typically used when objects
                            do not required to maintain their state between
                            method calls(Single Call ) or where there are
                            multiple clients who call methods on the same
                            object instance where the object maintains its
        Client object       state between function calls (singleton)




           Proxy
                                  In a client activated object the
                                  client initiates the object and
                                  manages it for its lifetime.

      Remoting System
Client application domain     Activation


                                                           SAO – Single call
                            What’s the capital of Canada


                            Ottawa

        Client object
                            Login Name: John
                                                           SAO – Singleton
                            OK
                            Send email to Bert
           Proxy
                            Ok


                                                             CAO- Client
      Remoting System       Get data                          Manages
                                                              Lifetime
                            Get data

                            Delete
Registering Remote Object
• Client must have some understanding of
  the interface of the remote object.
• So the compiler has check accesses to
  remote object
ActivationRegistering remote    Object mode : this defines the server
           object               activation, such as SingleCall or Singleton
    Client application domain   WellKnownObjectMode.SingleCall
                                Object URI: This is the indicator that the clients
                                use to locate the object
                                newClass.ShowCapital
                                Assembly name: This defines the assembly in
                                which the class is contained in.
              Client object     “ShowCapital1”
                                Type name : This defines the data type of the
                                remote object.
                                Typeof(newclass.ShowCapital)
                 Proxy

                                                              Remote
                                                              Object

                                           Class                               Method
            Remoting System
                                                   newClass.ShowCapitl

                                       Assembly        ShowCapital1
Activation         Object mode : this defines the server activation,
Client application domain   such as SingleCall or Singleton
                            WellKnownObjectMode.SingleCall
                            Object URI: This is the indicator that the clients
                            use to locate the object
                            newClass.ShowCapital
                            Assembly name: This defines the assembly in
                            which the class is contained in.
        Client object       “ShowCapital1”
                            Type name : This defines that data type of the
                            remote object.
                            Typeof(newclass.ShowCapital)
           Proxy

                                                         Remote
  Remote objects are registered using the RegisterWellKnownServiceType
                                                         Object
  Parameters are (data type , assembly name , activation method) .eg:

  RemotingConfiguration.RegisterWellKnownServiceType
     Remoting System
  (typeof(newClass.ShowCapital),”ShowCapital1”,
                                   newClass.ShowCapital
     WellKnownObjectMode.SingleTon
                                                Assembly : ShowCapital1
Activation
Client application domain

                RemotingConfiguration.Configure(“myconfig.config”);




        Client object




           Proxy

                                                       Remote
                                                       Object


      Remoting System
Client side
The remote object will not instantiate itself, the
client is required to initialize it, or call a method.
This is achieved by a client which knows the URI
of the remote object and by registering the
channel it prefers using GetObject :


TcpClientChannel channel = new TcpClientChannel();

ChannelServices.RegisterChannel(channel);
ShowCapital sh=(ShowCapital)Activator.GetObject
   (typeof(newClass.ShowCapital),
      ”tcp://localhost:1234/ShowCapital”);
Determining data type
Client requires type information about the class
when this client code is compiled.
  1- With a reference to the assembly where the class
  is stored (use local dll).
  2- Using SOAPSUDS tool to extract metadata
  directly from the endpoint. SOAPSUDS connects to
  the endpoint and extracts the metadata, and
  generates an assembly or source code that is then
  used in the client compilation.
  3-By splitting the remote object into an
  implementation and interface class and then use
  the interface as a reference when compiling the
  client

Contenu connexe

Tendances

ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
Doncho Minkov
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
Binu Bhasuran
 
Developing Distributed Web Applications, Where does REST fit in?
Developing Distributed Web Applications, Where does REST fit in?Developing Distributed Web Applications, Where does REST fit in?
Developing Distributed Web Applications, Where does REST fit in?
Srinath Perera
 
An operational view into docker registry with scalability, access control and...
An operational view into docker registry with scalability, access control and...An operational view into docker registry with scalability, access control and...
An operational view into docker registry with scalability, access control and...
Conference Papers
 

Tendances (20)

ADO.NET Entity Framework
ADO.NET Entity FrameworkADO.NET Entity Framework
ADO.NET Entity Framework
 
NGRX Apps in Depth
NGRX Apps in DepthNGRX Apps in Depth
NGRX Apps in Depth
 
Web of Things to the edge
Web of Things to the edgeWeb of Things to the edge
Web of Things to the edge
 
Building Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPABuilding Fast and Scalable Persistence Layers with Spring Data JPA
Building Fast and Scalable Persistence Layers with Spring Data JPA
 
Device Management with OMA Lightweight M2M
Device Management with OMA Lightweight M2MDevice Management with OMA Lightweight M2M
Device Management with OMA Lightweight M2M
 
LWM2M Introduction - Edinburgh 2016 Workshop with ARM
LWM2M Introduction - Edinburgh 2016 Workshop with ARMLWM2M Introduction - Edinburgh 2016 Workshop with ARM
LWM2M Introduction - Edinburgh 2016 Workshop with ARM
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]Introduction to dot net framework by vaishali sahare [katkar]
Introduction to dot net framework by vaishali sahare [katkar]
 
June 2014 - IPC in android
June 2014 - IPC in androidJune 2014 - IPC in android
June 2014 - IPC in android
 
Distributed System by Pratik Tambekar
Distributed System by Pratik TambekarDistributed System by Pratik Tambekar
Distributed System by Pratik Tambekar
 
Step talk
Step talkStep talk
Step talk
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Beginning with wcf service
Beginning with wcf serviceBeginning with wcf service
Beginning with wcf service
 
Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2
 
Developing Distributed Web Applications, Where does REST fit in?
Developing Distributed Web Applications, Where does REST fit in?Developing Distributed Web Applications, Where does REST fit in?
Developing Distributed Web Applications, Where does REST fit in?
 
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web ServicesIntroduction to SOAP/WSDL Web Services and RESTful Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
 
Web services
Web servicesWeb services
Web services
 
Introduction to .Net
Introduction to .NetIntroduction to .Net
Introduction to .Net
 
Architectural Patterns - Interactive and Event Handling Patterns
Architectural Patterns  - Interactive and Event Handling PatternsArchitectural Patterns  - Interactive and Event Handling Patterns
Architectural Patterns - Interactive and Event Handling Patterns
 
An operational view into docker registry with scalability, access control and...
An operational view into docker registry with scalability, access control and...An operational view into docker registry with scalability, access control and...
An operational view into docker registry with scalability, access control and...
 

En vedette

En vedette (10)

.Net Remoting
.Net Remoting.Net Remoting
.Net Remoting
 
Attributes & .NET components
Attributes & .NET componentsAttributes & .NET components
Attributes & .NET components
 
.NET Reflection
.NET Reflection.NET Reflection
.NET Reflection
 
Learning .NET Attributes
Learning .NET AttributesLearning .NET Attributes
Learning .NET Attributes
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
 
Session 6
Session 6Session 6
Session 6
 
Reflection in C#
Reflection in C#Reflection in C#
Reflection in C#
 
Net remoting
Net remotingNet remoting
Net remoting
 
Basics of WCF and its Security
Basics of WCF and its SecurityBasics of WCF and its Security
Basics of WCF and its Security
 
Ch08 Authentication
Ch08 AuthenticationCh08 Authentication
Ch08 Authentication
 

Similaire à Net remoting

dotnet_remoting
dotnet_remotingdotnet_remoting
dotnet_remoting
OPENLANE
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
Ravi Theja
 

Similaire à Net remoting (20)

DS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdfDS R16 - UNIT-3.pdf
DS R16 - UNIT-3.pdf
 
Remote Method Invocation
Remote Method InvocationRemote Method Invocation
Remote Method Invocation
 
Remote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVARemote Method Innovation (RMI) In JAVA
Remote Method Innovation (RMI) In JAVA
 
Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01Javarmi 130925082348-phpapp01
Javarmi 130925082348-phpapp01
 
Java rmi
Java rmiJava rmi
Java rmi
 
Rmi
RmiRmi
Rmi
 
dotnet_remoting
dotnet_remotingdotnet_remoting
dotnet_remoting
 
Remoting and serialization
Remoting and serializationRemoting and serialization
Remoting and serialization
 
javarmi
javarmijavarmi
javarmi
 
Rmi ppt-2003
Rmi ppt-2003Rmi ppt-2003
Rmi ppt-2003
 
Distributed objects
Distributed objectsDistributed objects
Distributed objects
 
MIDELWARE TECH
MIDELWARE TECHMIDELWARE TECH
MIDELWARE TECH
 
Lec7
Lec7Lec7
Lec7
 
Module 3 remote method invocation-2
Module 3   remote method  invocation-2Module 3   remote method  invocation-2
Module 3 remote method invocation-2
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
Java RMI
Java RMIJava RMI
Java RMI
 
My Rmi F
My Rmi FMy Rmi F
My Rmi F
 
RMI (Remote Method Invocation)
RMI (Remote Method Invocation)RMI (Remote Method Invocation)
RMI (Remote Method Invocation)
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 

Dernier

Dernier (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Net remoting

  • 2. Distributed Application Remote Distributed systems are Service Remote generally more scalable , more Service robust and increase availability of services Client Requests remote process Common distributed protocols are: RPC : Remote Procedure Calls Server runs the DCOM : MS Distributed Service/process and Object Model returns the result CORBA : Common Object Request Broker Architecture Client RMI : Java Remote Invocation Not Secure for Remote external networks Service
  • 3. Distributed Application Remote Remote Objects Objects Communication .Net Remoting allows Channel access to objects Application placed around a Domain network.It has: (Assembly) •Communication channel •A formatter : This can be Local Binary encoded or XML Objects encoded (SOAP) Remote Objects
  • 4. Communication Channel Communication Channel Application Domain (Assembly) Formatter: Binary Remote Fast but not as Objects compatible as XML Local Objects Remote Objects Formatter: XML (SOAP) Highly compatible but not as fast
  • 5. Remoting Overview Application Domain (Assembly) Local Object Remote Object Different Assemblies are used between Local and remote Service Typically dll
  • 6. Remote object lifetime Application Domain (Assembly) Local Service Remote Service Does the object persists?
  • 7. Local Objects Application Domain (Assembly) Application Public void myObject (myObjectClass obj) Pass By Value { } Local Object Pass By Reference Public void myObject (ref myObjectClass obj) Local { Object } Within Local Assembly
  • 8. Remote Object System Application Domain (Assembly) Local Object Remote Serialize Desterilize Object Encapsulate Formatter Decapsulate (SOAP) (Encoder) (SOAP) Communicate Communicate
  • 9. Remote Object Activation Client activated objects These have a finite lease time , Once their lease time expires they are left for garbage collector. Each caller would get their copy of the object Application Remote Object Server Activated Object Namespace used for remoting: System.Net :This include classes Singleton :All clients get the same related to the networking elements instance of the server object. It can of the distributed system communicate with multiple clients . Life System.Runtime.Remoting : This time is determined by lease based includes classes for the remote lifetime (Used for chats, community aspects of the .NET framework , such networks) as mechanism for remote Single Call :Is a type of object activation communication between objects when object is discarded immediately System.Web.Services :This includes after use. It is stateless. protocols relating to Web services such as those to HTTP and SOAP encapsulation
  • 10. Client application domain Marshaling Server application domain Local Objects passed by reference or value for local objects . Remote Object Object For remote it is not possible to pass by reference – Remote objects must be Client object marshaled Server Object Proxy Remoting System Communication Remoting System Channel Serialization
  • 11. Client application domain Marshaling Server application domain Remote Object Local public class ShowCapital : MarshalByRefObject Remote { Object Object public ShowCapital() { } Client object public string show ( string country) { aCountry capital } } Creates dll Proxy on server ShowCapital() aCountry capital Remoting System Communication Remoting System Channel Serialization
  • 12. Client application domain Marshaling Server application domain Remote Local Object Object Object.dll Access public methods of remotable obj Client object aCountr capital y Proxy ShowCapital() aountry capital Remoting System Communication Remoting System Channel Serialisation
  • 13. Client application domain Marshaling Server application domain Remote Local Object Object Object.dll Client object We need object invocation. And channel configuration. Eg. TCP channel 1234 , firewalls should allow Proxy channel ShowCapital() Remoting System Communication Remoting System Channel Serialisation
  • 14. Channels • TCP Channel – Faster and more secure communication. Intended predominantly for intra-domain communication. Requires port activation for communication with external world • HTTP Channel performed using HTTP/SOAP protocol. Good for external communication since it is implemented over HTTP/HTTPS and most firewalls allow HTTP calls through.
  • 15. Client application domain TCP Channel Using System.Runtime.Remoting.Channel.Http Using System.Runtime.Remoting.Channel.Tcp Local Object TcpChannel channel = new TcpChannel(1234) ChannelServices.RegisterChannel(channel) Client object Makes sure channel is not used by other apps Proxy Channel=1234 Remoting System Communication Channel Server activation object
  • 16. Client application domain Activation Server application domain Remote Object Object.dll Channels map onto TCP ports.. Client object Standard ports are: 21-FTP 23-TELNET 56-DNS Proxy 80-www ShowCapital() 110-POP 3 >1024 : developer use Remoting System Communication Remoting System Channel Serialisation
  • 17. Client application domain Activation Server Activation is typically used when objects do not required to maintain their state between method calls(Single Call ) or where there are multiple clients who call methods on the same object instance where the object maintains its Client object state between function calls (singleton) Proxy In a client activated object the client initiates the object and manages it for its lifetime. Remoting System
  • 18. Client application domain Activation SAO – Single call What’s the capital of Canada Ottawa Client object Login Name: John SAO – Singleton OK Send email to Bert Proxy Ok CAO- Client Remoting System Get data Manages Lifetime Get data Delete
  • 19. Registering Remote Object • Client must have some understanding of the interface of the remote object. • So the compiler has check accesses to remote object
  • 20. ActivationRegistering remote Object mode : this defines the server object activation, such as SingleCall or Singleton Client application domain WellKnownObjectMode.SingleCall Object URI: This is the indicator that the clients use to locate the object newClass.ShowCapital Assembly name: This defines the assembly in which the class is contained in. Client object “ShowCapital1” Type name : This defines the data type of the remote object. Typeof(newclass.ShowCapital) Proxy Remote Object Class Method Remoting System newClass.ShowCapitl Assembly ShowCapital1
  • 21. Activation Object mode : this defines the server activation, Client application domain such as SingleCall or Singleton WellKnownObjectMode.SingleCall Object URI: This is the indicator that the clients use to locate the object newClass.ShowCapital Assembly name: This defines the assembly in which the class is contained in. Client object “ShowCapital1” Type name : This defines that data type of the remote object. Typeof(newclass.ShowCapital) Proxy Remote Remote objects are registered using the RegisterWellKnownServiceType Object Parameters are (data type , assembly name , activation method) .eg: RemotingConfiguration.RegisterWellKnownServiceType Remoting System (typeof(newClass.ShowCapital),”ShowCapital1”, newClass.ShowCapital WellKnownObjectMode.SingleTon Assembly : ShowCapital1
  • 22. Activation Client application domain RemotingConfiguration.Configure(“myconfig.config”); Client object Proxy Remote Object Remoting System
  • 23. Client side The remote object will not instantiate itself, the client is required to initialize it, or call a method. This is achieved by a client which knows the URI of the remote object and by registering the channel it prefers using GetObject : TcpClientChannel channel = new TcpClientChannel(); ChannelServices.RegisterChannel(channel); ShowCapital sh=(ShowCapital)Activator.GetObject (typeof(newClass.ShowCapital), ”tcp://localhost:1234/ShowCapital”);
  • 24. Determining data type Client requires type information about the class when this client code is compiled. 1- With a reference to the assembly where the class is stored (use local dll). 2- Using SOAPSUDS tool to extract metadata directly from the endpoint. SOAPSUDS connects to the endpoint and extracts the metadata, and generates an assembly or source code that is then used in the client compilation. 3-By splitting the remote object into an implementation and interface class and then use the interface as a reference when compiling the client