1.3.1 Remote Method Invocation Model

 The .NET Remoting Protocol specifies a mechanism to invoke a method where the calling program and the target method are in different address spaces. Following is an example.

The .NET Remoting Protocol

Figure 1: The .NET Remoting Protocol

This protocol defines two roles: client and server. A client initiates communication by calling a Remote Method with Input Arguments using a Proxy. The server responds by executing the method in an implementation-specific manner. The Remote Method can be either a One-Way or a Two-Way Method. If the method is One-Way, then no response is sent back to the client. If the method is Two-Way, then the server sends back a response that can contain a Return Value and Output Arguments.

The protocol defines two mechanisms for exchanging additional data with each Remote Method call: Call Context and Message Properties.

A Call Context is a collection of name-value pairs. A client can add name-value pairs to the Call Context of a Remote Method. The Call Context is then transmitted when the Remote Method is invoked. The server can then modify the Call Context before it transmits the updated Call Context back to the client.

Message Properties is another collection of name-value pairs that behaves in the same way as Call Context. Values in the Call Context are intended to be used for transmitting application-defined values, while the Message Properties are intended to be used for infrastructure-defined values. This protocol does not define any values that are carried as Message Properties or Call Context values.

Remote Method implementations can choose to return an Exception to the caller to indicate an error in processing. Server-side errors such as a connection error, a data validity error, or a server availability error are returned to the client as one of two Exceptions: Remoting Exception or Serialization Exception.

Remote Method Arguments, Return Value, Call Context, Message Properties, and Exceptions are all represented by Data Values.