3.1.4.1 Activate

The Activate method activates a Server Object. The parameter specifies the Server Type of the Server Object.

 System.Runtime.Remoting.Messaging.ConstructionResponse
 Activate(
   System.Runtime.Remoting.Messaging.ConstructionCall callMessage);
  

callMessage:  An instance of ConstructionCall that contains information that is required to activate the Server Object.

Return Values:  An instance of ConstructionResponse that contains the activated Server Object.

Exceptions:  If the Server Object cannot be activated, a RemotingException (as specified in [MS-NRTP] section 2.2.2.9) MUST be thrown. If the callMessage parameter does not fulfill the constraints (as specified in ConstructionCall, section 2.2.2), then a RemotingException MUST be constructed (as specified in [MS-NRTP] section 3.2.5.1.7.2). The Exception MUST be sent back to the client.

The implementation MUST look up the target Server Type in the Activatable Types Table. The implementation SHOULD use the __TypeName field of the callMessage parameter as a key, but MAY use other information instead or in addition. If no matching entry is found in the table, a RemotingException MUST be constructed (as specified in [MS-NRTP] section 3.2.5.1.7.2) and sent back to the client.<9>

Once the Server Type information is obtained, the implementation MUST select the Constructor Method Signature for the activation as follows:

  • If there is exactly one Constructor Method Signature associated with the Server Type in the Activatable Types Table, then that is the Constructor Method Signature for the activation.

  • If there is more than one Constructor Method Signature associated with the Server Type, then the Constructor Method Signature that matches exactly the __MethodSignature field of the callMessage parameter is selected. Two arrays match exactly if they have the same number of elements and each member of the one array has the same value as the corresponding member of the other array.

    If the implementation is unable to select a Constructor Method Signature to match the incoming Activate request, a RemotingException MUST be constructed (as specified in [MS-NRTP] section 3.2.5.1.7.2) and sent back to the client.

    Once the Constructor Method Signature is selected, the implementation SHOULD validate that the incoming argument data in the __Args field of the callMessage argument is assignable to the arguments specified in the Constructor Method Signature using the rules specified in [MS-NRTP] section 3.1.1 in the definition of Remote Method.

    If the incoming argument data fails validation, the implementation SHOULD construct a RemotingException (as specified in [MS-NRTP] section 3.2.5.1.7.2) and send it back to the client.

    The implementation then MUST create an instance of the Server Type in an implementation-specific manner.

The implementation MUST construct a ConstructionResponse as specified in section 2.2.5, with the following additional constraints:

  • The __Return field of the ConstructionResponse MUST be set to the newly created Server Object.

  • The __MethodName MUST match the __MethodName field of the incoming ConstructionCall instance.

  • The __TypeName MUST match the __TypeName field of the incoming ConstructionCall instance.

The ConstructionResponse instance MUST be sent back as the return value of the method.