public string GetReportFax(string userName, string password, string faxID) { string status = string.Empty; switch (Configuration.Config.Environment()) { case Configuration.TIMEnvironment.Development: case Configuration.TIMEnvironment.Demo: case Configuration.TIMEnvironment.Test: Array values = System.Enum.GetValues(typeof(FaxResult)); Random random = new Random(); int randomValueCustom = GetRandomValue(values); FaxResult randomStatus = (FaxResult)values.GetValue(randomValueCustom); status = randomStatus.ToString(); break; case Configuration.TIMEnvironment.Production: { Faxolution201203Client client = new Faxolution201203Client(); reportRequest report = new reportRequest(); report.username = userName; report.password = password; report.jobId = faxID; reportResponse reportResponse = client.getFaxReport(report); status = reportResponse.faxRecipient[0].status; } break; default: break; } return(status); }
/// <summary> /// Report a Person via authenticated PL web service /// </summary> /// <param name="content">XML string</param> /// <returns>Empty string if OK, otherwise error message</returns> private async Task<string> ReportPersonFirstTime(string content) { App.MyAssert(App.pd.plToken != null && App.pd.plToken.Length == 128); // token is 128 char long SHA-512 /* Win 7: string errorCode = ""; string errorMessage = ""; string url = ""; string plname = parent.pd.DecryptPLUsername(); string plpass = parent.pd.DecryptPLPassword(); */ // was v33: reportPersonRequest rpin = new reportPersonRequest(); // was v34: reportPersonResponse rpout = new reportPersonResponse(); reportRequest rpin = new reportRequest(); reportResponse rpout = new reportResponse(); try { SetPLEndpointAddress(App.pl); //read the configured endpoint address if(App.BlockWebServices) throw new Exception(PHONY_COMMUNICATIONS_EXCEPTION); /* Win 7: url = App.pl.reportPerson( content, parent.os.EventShortNameText, "TRIAGEPIC1", plname, plpass, out errorCode, out errorMessage);*/ /* v32: rpin.username = App.pd.plUserName; // await App.pd.DecryptPL_Username(); rpin.password = App.pd.plPassword; // await App.pd.DecryptPL_Password(); rpin.xmlFormat = "TRIAGEPIC1"; rpin.eventShortName = App.CurrentDisaster.EventShortName; rpin.personXML = content; */ rpin.token = App.pd.plToken; rpin.payload = content; rpin.payloadFormat = "TRIAGEPIC1"; rpin.shortname = App.CurrentDisaster.EventShortName; // was v33: rpout = await App.pl.reportPersonAsync(rpin); rpout = await App.pl.reportAsync(rpin); } catch (Exception e) { return "ERROR: " + e.Message; } if (rpout.errorCode != 0) // was v33: "0" return PackageErrorString(rpout.errorCode.ToString(), rpout.errorMessage); App.CacheUuidOfMostRecentReportSent = rpout.uuid; // VERSION 3.7 ROLLBACK ROLLFORWARD // Corresponding App.CacheIdOfMostRecentReportSent is set by caller return ""; //Win 7: CAUSES PROBLEMS FOR CALLER: return url; }