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 22.214.171.124) 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.
SPUserCodeExecutionPipelineTerminallyFailedException (section 126.96.36.199)
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 188.8.131.52)
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 184.108.40.206)
The protocol server MUST throw this exception when the user code being executed on the protocol server has failed.
SPUserCodeValidationFailedException (section 220.127.116.11)
The protocol server MUST throw this exception when a failure is encountered while validating the assembly group that contains the user code.