Example #1
0
 public ApigeeResponse(JToken rawData, string wantedKey)
 {
     RawResponse = rawData.ToString();
     try
     {
         this.ResponseData = rawData[wantedKey];
         this.success      = true;
     }
     catch (Exception)
     {
         this.Error   = new ApigeeResponseError("error");
         this.success = false;
     }
 }
Example #2
0
 public ApigeeResponse(JToken rawData, string wantedKey)
 {
     RawResponse = rawData.ToString();
     try
     {
         this.ResponseData = rawData[wantedKey];
         this.success = true;
     }
     catch (Exception)
     {
         this.Error = new ApigeeResponseError("error");
         this.success = false;
     }
 }
Example #3
0
 public ApigeeResponse(string rawData, bool ExtractEnteties) 
 {
     RawResponse = rawData;
     if (!ExtractEnteties) return; //safty
     var enteties = GetEntitiesFromJson(rawData);
     if (enteties == null)
     {
         this.success = false;
         this.Error = new ApigeeResponseError(JObject.Parse(rawData));
     }
     else 
     {
         this.success = true;
         this.ResponseData = enteties;
     }
 }
Example #4
0
 public ApigeeResponse(JObject rawData, string wantedKey) {
     RawResponse = rawData.ToString();
     try
     {
         this.ResponseData = rawData.SelectToken(wantedKey, true);
         this.success = true;
     }
     catch (Exception)
     {
         var errorMsg = rawData.SelectToken("error_description").ToString();
         if (String.IsNullOrEmpty(errorMsg))
             errorMsg = "Unknown Error";
         
         this.Error = new ApigeeResponseError(errorMsg);
         this.success = false;
     }
 }
Example #5
0
        public ApigeeResponse(JObject rawData, string wantedKey)
        {
            RawResponse = rawData.ToString();
            try
            {
                this.ResponseData = rawData.SelectToken(wantedKey, true);
                this.success      = true;
            }
            catch (Exception)
            {
                var errorMsg = rawData.SelectToken("error_description").ToString();
                if (String.IsNullOrEmpty(errorMsg))
                {
                    errorMsg = "Unknown Error";
                }

                this.Error   = new ApigeeResponseError(errorMsg);
                this.success = false;
            }
        }
Example #6
0
        public ApigeeResponse(string rawData, bool ExtractEnteties)
        {
            RawResponse = rawData;
            if (!ExtractEnteties)
            {
                return;                   //safty
            }
            var enteties = GetEntitiesFromJson(rawData);

            if (enteties == null)
            {
                this.success = false;
                this.Error   = new ApigeeResponseError(JObject.Parse(rawData));
            }
            else
            {
                this.success      = true;
                this.ResponseData = enteties;
            }
        }