예제 #1
0
 // Methods
 internal RestRequest(HttpRequest httpRequest, RestOperation operation)
 {
     this._httpRequest = httpRequest;
     this._operation = operation;
     this._parsedParameters = new Dictionary<string, object>();
     this._contentType = operation.DefaultResponseContentType;
     this._scriptCallback = _httpRequest.QueryString["callback"];
 }
예제 #2
0
 private void AddOperation(RestOperation operation)
 {
     if (this._operations.ContainsKey(operation.Name))
     {
         throw new InvalidOperationException("An overload of the method '" + operation.Method.Name + "' was already defined. Overloaded methods are not supported as RPC operations.");
     }
     try
     {
         this.AddType(operation.ReturnType);
         foreach (ParameterInfo info in operation.ParameterList)
         {
             this.AddType(info.ParameterType);
         }
     }
     catch (Exception exception)
     {
         throw new RestException(500, "The method '" + operation.Method.Name + "' uses an unsupported type in its signature.", exception);
     }
     this._operations[operation.Name] = operation;
     this._operationList.Add(operation);
 }