public GstnResponse GetBlobConnectionByToken(string token) { UserData objData = new UserData(); Blob objBlob = new Blob(); GstnResponse objResponse = new GstnResponse(); //string response = "{\"username\":\"WeP.MH.2\",\"reqtoken\":\"6196546c-7e97-4d7b-8f48-9cb5638711e4_636373399124528642\",\"data\":\"8hanCrLzY9xGcGUzDmrgX99Y4gE45o+iOKSVcFVPZV/PXOVNODOdNk9sUwhEF2XVFyt+I+29MzPsD4FwtTmuzGQXtTcQkn2haUCYHn8ELqg=\",\"hmac\":\"i0zctLJMBiHknQfWKbmj9EAiCi8SxKNkCDVZBbLa/Is=\",\"status_cd\":1,\"rek\":\"mEt9TaWPIpiv9Qqf0A/O8fwI2VER+Pz50wZN/gsxx5mVw6sU+AiaO9wRbmJTrWds\",\"apiAction\":\"GSTR1_SaveGSTR1\",\"respBlobId\":0}"; //var results = JsonConvert.DeserializeObject<GstnResponse>(response); objBlob = objData.GetBlobConnectionByToken(token); var blobStorageRetry = new BlobWithRetry(objBlob.Connection, Constants.GstnResponseContainer , token, new Dictionary <string, string>(), objBlob.Id); objResponse = blobStorageRetry.DownloadGStnRespBlobRetry(); return(objResponse); //return null; }
/// <summary> /// ProcessGSTR3BFileData /// </summary> /// <param name="request"></param> /// <returns></returns> internal ServiceResponse <string> ProcessGSTR3BFileData(Request request) { #region Download from blob storage // ConfigData configData = new ConfigData(); var blob = new WEP.GSP.CacheManager.CacheManager().GetBlob(request.Blob); var blobStorageRetry = new BlobWithRetry(blob.Connection, Constants.CotainerPayload , request.BlobFile, new Dictionary <string, string>(), request.Blob); Attrbute attribute = blobStorageRetry.DownloadBlobRetry(); #endregion //Serialize to string string jsonReqst = new JavaScriptSerializer().Serialize(request); //log to table storage => P2 started TableStorage objTableStorage = new TableStorage(Constants.PartitionKey, Constants.RowKey , request.RequestToken , Constants.GSTNStageP2Table , Constants.actualTime); Task.Factory.StartNew(() => objTableStorage.InsertStageToTableStorage(blob.Keys, (int)WEP.GSP.Document.Stage.Response_Invoke_BEGIN)); //Sends request GSTN request.Response = new GSTR3B(request.Clientid , request.Statecd , request.Username , request.Txn , request.AuthToken , request.ClientSecret , request.IpUsr , request.RetPeriod , request.Gstin , request.RequestToken , request.ApiAction) .ExecuteGSTR3BFileDataWithRetry(attribute); request.ModifiedOn = System.DateTime.UtcNow.ToString(); //Upload response to blob var gstnStorageRespBlob = CommonFunction.GetGstnRespBlob(); var blobStorageGstn = new BlobStorage(gstnStorageRespBlob.Connection, Constants.GstnResponseContainer , request.BlobFile, new Dictionary <string, string>(), gstnStorageRespBlob.Id); var results = JsonConvert.DeserializeObject <GstnResponse>(request.Response); var blobPath = blobStorageGstn.UploadBlob(results); results.reqtoken = request.RequestToken; results.username = request.Username; results.apiAction = request.ApiAction; results.blobUrl = blobPath; results.respBlobId = gstnStorageRespBlob.Id; //save response blob url to database table new RequestData().InsertResponseLog(results); //Pipeline Handler //log to table storage => P2 end Task.Factory.StartNew(() => objTableStorage.InsertStageToTableStorage(blob.Keys, (int)WEP.GSP.Document.Stage.Response_Invoke_SUCCESS)); var respone = new ServiceResponse <string> { ResponseObject = request.Response, IsError = false }; return(respone); }