private string GetUrlString(FractalQueueItem fqi) { string url = _odataService_RootURL_Json; // resolution url = url + @"?$filter=Resolution%20eq%20" + fqi.Resolution.ToString(); // x interval int xmin = (int)(fqi.XStart * (float)fqi.Resolution); url = url + @"%20and%20XCoord%20ge%20" + xmin.ToString(); int xmax = (int)(fqi.XEnd * (float)fqi.Resolution); url = url + @"%20and%20XCoord%20le%20" + xmax.ToString(); // y interval int ymin = (int)(fqi.YStart * (float)fqi.Resolution); url = url + @"%20and%20YCoord%20ge%20" + ymin.ToString(); int ymax = (int)(fqi.YEnd * (float)fqi.Resolution); url = url + @"%20and%20YCoord%20le%20" + ymax.ToString(); // format url = url + @"&$format=json"; WriteLine("--> GetUrlString gives URL: {0}", url); return url; }
/// <summary> /// Kick off an HTTP request asynchronously /// </summary> private void ProcessQueueItem(FractalQueueItem fqi) { try { string urlString = GetUrlString(fqi); HttpWebRequest request; request = (HttpWebRequest)HttpWebRequest.Create(urlString); request.Credentials = new System.Net.NetworkCredential(HanaServerDetails.UserName, HanaServerDetails.Password); TrackerObjectHttp trackerObjectHttp = new TrackerObjectHttp(request, "tag"); request.BeginGetResponse(CallbackGetFractalFromHana_Json, trackerObjectHttp); WriteLine("--> GetFractalFromHana_Json called"); } catch (Exception e) { WriteLine("ERROR: ProcessQueueItem failed exception: {0}", e.Message); } finally { } }