public bool DeletePossibleDuplicate(GMPossibleDuplicate selectedPossibleDuplicate, User user) { bool deletionSuccess = false; string jsonResult = string.Empty; string deletePossibleDuplicateSOAsJson = string.Empty; DeletePossibleDuplicateSO deletePossibleDuplicateSO = new DeletePossibleDuplicateSO(); GoldmineImportServiceDO goldmineImportServiceDO = new GoldmineImportServiceDO(); deletePossibleDuplicateSO = PropertyAddition.SetDeletePossibleDuplicateSOProperties(deletePossibleDuplicateSO, selectedPossibleDuplicate, user); string URL = string.Format("{0}DeletePossibleDuplicate", goldmineImportServiceAddress); WebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(URL); httpWebRequest = ConnectorHelper.SetUpWebRequestObject(httpWebRequest); deletePossibleDuplicateSOAsJson = SerializationHelper.SerializeDeletePossibleDuplicateSO(deletePossibleDuplicateSO); using (StreamWriter streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) { try { streamWriter.Write(deletePossibleDuplicateSOAsJson); streamWriter.Flush(); streamWriter.Close(); } catch (Exception ex) { ClientLogger.WriteError(ex, "Error deleteing Possible Duplicate.\nMethod: GoldmineImportServiceConnector.CreateHistoryRecordForRiftId", ClientGlobalData.CurrentUser.SystemName); throw ex; } } // get response HttpWebResponse httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); using (StreamReader streamReader = new StreamReader(httpResponse.GetResponseStream())) { jsonResult = streamReader.ReadToEnd(); jsonResult = ConnectorHelper.ChangeArrayParentheses(jsonResult); } // deserialize try { goldmineImportServiceDO = JsonConvert.DeserializeObject <GoldmineImportServiceDO>(jsonResult); deletionSuccess = goldmineImportServiceDO.DeletePossibleDuplicateResult; } catch (Exception ex) { ClientLogger.WriteError(ex, "Error deserializing result for deleteing Possible Duplicate.\nMethod: GoldmineImportServiceConnector.CreateHistoryRecordForRiftId", ClientGlobalData.CurrentUser.SystemName); HandleDeserializationException(ex); } return(deletionSuccess); }