コード例 #1
0
        public override ConvertServiceResponse ProcessServiceRequest(ConvertServiceRequest request)
        {
            var response = new ConvertServiceResponse();

            if (request.Parameters.ContainsKey(CommonParameters.AuthorizationToken))
            {
                // Get data for requested authorization token
                response.ResponseData = GetAuthorizationTokenData(request.Parameters[CommonParameters.AuthorizationToken], true);
            }
            else
            {
                // Attempt to create and return a new authorization token
                response.ResponseData = CreateAuthorizationToken(request.Parameters);
            }

            // Add error message to response if applicable
            if (!string.IsNullOrEmpty(_errorMessage))
                response.AddError(_errorMessage);

            return response;
        }
コード例 #2
0
 public DataProviderResponse(ConvertServiceResponse response)
 {
     Data = response.ResponseData;
     Parameters = (Dictionary<string,string>)response.ResponseParameters;
 }