3.1.5.1 Execute

The Execute method is called to run a user code request on the protocol server.

  object Execute(Type userCodeWrapperType,
                 Guid siteCollectionId,
                 SPUserToken userToken,
                 string affinityBucketName,
                 SPUserCodeExecutionContext executionContext);
  

userCodeWrapperType: The type of object the protocol server uses to execute this user code request. This parameter is a vendor-extensible field and can contain the type of any object.<16>

siteCollectionId: A site collection identifier of the current site collection.

userToken: A token (section 2.2.2.30) that identifies the authentication process applied to the current user.

affinityBucketName: A string to suggest a loose affinity between different user code requests. The protocol server can use this string as a suggestion when grouping user code requests together to reuse resources.

executionContext: Context data specific to this user code request. This parameter is a vendor-extensible field and can contain any type that derives from the type SPUserCodeExecutionContext.  

Return value: The results of executing this user code request. The type returned is a vendor-extensible field and can be any type that derives from the type System.Object.

Exceptions: If an error occurs while processing this method, one of the exceptions that are listed in the following table will be raised.

Exception

Description

SPUserCodeExecutionPipelineTerminallyFailedException (section 2.2.2.14)

The protocol server MUST throw this exception when the protocol server has encountered an unrecoverable and terminal failure. The protocol client MUST NOT send any more Execute requests to the protocol server after this exception has been thrown until the Ping method returns true.

SPUserCodeExecutionPipelineFailedException (section 2.2.2.15)

The protocol server MUST throw this exception when the protocol server itself has encountered an error while attempting to execute the user code request.

SPUserCodeSolutionExecutionFailedException (section 2.2.2.18)

The protocol server MUST throw this exception when the user code being executed on the protocol server has failed.

SPUserCodeValidationFailedException (section 2.2.2.19)

The protocol server MUST throw this exception when a failure is encountered while validating the assembly group that contains the user code.

Any exception raised by the .NET Remoting Core Protocol as specified in [MS-NRTP] section 2.2.2