static void Main(string[] args) { try { Tieto.HCW.Framework.Net.Policy.SetPolicy(); Tieto.HCW.Framework.Net.Policy.ValidationFailed += Policy_ValidationFailed; String path = Path.Combine(Directory.GetCurrentDirectory(), "TestMOCES1.pfx"); X509Certificate2 moces = new X509Certificate2(path, "Test1234"); CreateChildMeasurementReportType report = new CreateChildMeasurementReportType(); report.ChildMeasurement = new ChildMeasurementType(); report.ChildMeasurement.MeasurementDate = DateTime.Parse("2009-03-18"); report.ChildMeasurement.PersonHeight = 1.11M; report.ChildMeasurement.PersonWeight = 22.2M; report.ChildMeasurement.PersonCivilRegistrationIdentifier = "xxxxxxxxxx"; report.ChildMeasurement.InstitutionIdentifier = "031011"; BDBChildMeasurementReport.BDBChildMeasurementReport service = new BDBChildMeasurementReport.BDBChildMeasurementReport(); service.SetPolicy(new DGWSPolicy(moces)); // service.Url = @"http://*****:*****@"https://testei.sst.dk/DGWS/BDBChildMeasurementReport.asmx"; // service.Url = @"https://seidgws.sst.dk/DGWS/BDBChildMeasurementReport.asmx"; String s = service.CreateChildMeasurementReport(report); System.Diagnostics.Debug.WriteLine(s); } catch (SoapHeaderException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } catch (SoapException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } }
static void Main(string[] args) { try { // Tieto.HCW.Framework.Net.Policy.SetPolicy(); // Tieto.HCW.Framework.Net.Policy.ValidationFailed += Policy_ValidationFailed; String path = Path.Combine(Directory.GetCurrentDirectory(), "TestMOCES1.pfx"); X509Certificate2 moces = new X509Certificate2(path, "Underskriv2"); // path = Path.Combine(Directory.GetCurrentDirectory(), "TestVOCES1.pfx"); // X509Certificate2 voces = new X509Certificate2(path, "Test1234"); BDBNonGPChildReport service = new BDBNonGPChildReport(); // service.SetPolicy(new DGWSPolicy(moces, voces)); service.SetPolicy(new DGWSPolicy(moces, moces)); /*CREATE TEST*/ CreateChildMeasurementReportType report = new CreateChildMeasurementReportType(); report.ChildMeasurement = new ChildMeasurementType(); report.ChildMeasurement.MeasurementDate = DateTime.Parse("2009-03-18"); report.ChildMeasurement.PersonHeight = 1.11M; report.ChildMeasurement.PersonWeight = 22.2M; report.ChildMeasurement.PersonCivilRegistrationIdentifier = "1901075766"; // report.ChildMeasurement.InstitutionIdentifier = "157"; // report.ChildMeasurement.InstitutionIdentifier = "101168"; // report.ChildMeasurement.InstitutionIdentifier = "031011"; report.ChildMeasurement.InstitutionIdentifier = "12"; String s = service.CreateChildMeasurementReport(report); System.Diagnostics.Debug.WriteLine(s); /*MODIFY TEST*/ /* ModifyChildMeasurementReportType report = new ModifyChildMeasurementReportType(); * report.ChildMeasurement = new ChildMeasurementType(); * report.ChildMeasurement.MeasurementDate = DateTime.Parse("2007-12-30"); * report.ChildMeasurement.PersonHeight = 1.46M; * report.ChildMeasurement.PersonWeight = 7.3M; * report.ChildMeasurement.PersonCivilRegistrationIdentifier = "1901075766"; * report.ChildMeasurement.InstitutionIdentifier = "031011"; * report.UniversallyUniqueIdentifier = "bd174000-4aa8-4dd6-8816-09b39cd368cf"; * String s = service.ModifyChildMeasurementReport(report); * System.Diagnostics.Debug.WriteLine(s); */ /*DELETE TEST*/ /* DeleteChildMeasurementReportType report = new DeleteChildMeasurementReportType(); * report.UniversallyUniqueIdentifier = "bd174000-4aa8-4dd6-8816-09b39cd368cf"; * bool b = service.DeleteChildMeasurementReport(report); */ /*BREASTFEEDING TEST*/ /* ExclusivelyBreastFeedingPeriodEndReportType amningReport = new ExclusivelyBreastFeedingPeriodEndReportType(); * amningReport.ExclusivelyBreastFeedingPeriodEnd = DateTime.Parse("2001-06-20"); * amningReport.PersonCivilRegistrationIdentifier = "1312814435"; * bool b = service.SetExclusivelyBreastFeedingPeriodEndReport(amningReport); */ /*PASSIVESMOKING TEST*/ /* ExposedToPassiveSmokingReportType passiveSmoking = new ExposedToPassiveSmokingReportType(); * passiveSmoking.PersonCivilRegistrationIdentifier = "1312814435"; * passiveSmoking.ExposedToPassiveSmoking = ExposedToPassiveSmokingType.Unknown; * bool b = service.SetExposedToPassiveSmokingReport(passiveSmoking); */ } catch (SoapHeaderException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } catch (SoapException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } }