diff --git a/README.md b/README.md index d877b84..0a5ac4d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Install-Package WcfSoapLogger ## Usage examples ## -The repository contains [usage examples](/src/UsageExamples) covering different scenarios. +The repository contains **[usage examples](/src/UsageExamples)** covering different scenarios. To clone run this command or download as [zip file](https://github.com/capslocky/WcfSoapLogger/archive/master.zip). ``` git clone https://github.com/capslocky/WcfSoapLogger.git diff --git a/src/UsageExamples/ExampleAlpha/Client/App.config b/src/UsageExamples/ExampleAlpha/Client/App.config index 46688f2..a6ad41c 100644 --- a/src/UsageExamples/ExampleAlpha/Client/App.config +++ b/src/UsageExamples/ExampleAlpha/Client/App.config @@ -3,7 +3,7 @@ - diff --git a/src/UsageExamples/ExampleAlpha/Service/App.config b/src/UsageExamples/ExampleAlpha/Service/App.config index 453d0ff..468ab2f 100644 --- a/src/UsageExamples/ExampleAlpha/Service/App.config +++ b/src/UsageExamples/ExampleAlpha/Service/App.config @@ -6,7 +6,7 @@ - + - diff --git a/src/UsageExamples/ExampleBeta/Service/App.config b/src/UsageExamples/ExampleBeta/Service/App.config index 73344c3..6295949 100644 --- a/src/UsageExamples/ExampleBeta/Service/App.config +++ b/src/UsageExamples/ExampleBeta/Service/App.config @@ -6,7 +6,7 @@ - + (); var memoryStream = new MemoryStream(); @@ -45,6 +51,5 @@ private float GetRandomValue(float minimum, float maximum) { return (float)_random.NextDouble() * (maximum - minimum) + minimum; } - } } diff --git a/src/UsageExamples/ExampleCommon/CommonService/ReportRepository.cs b/src/UsageExamples/ExampleCommon/CommonService/ReportRepository.cs index 15a7216..2728ac4 100644 --- a/src/UsageExamples/ExampleCommon/CommonService/ReportRepository.cs +++ b/src/UsageExamples/ExampleCommon/CommonService/ReportRepository.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace CommonService { @@ -13,6 +14,12 @@ public long Add(WeatherReport report) { report.Id = _reports.Count + 1; _reports.Add(report); + + if (report.Id % 5 == 0) + { + throw new InvalidOperationException($"Oops! Report with ID '{report.Id}' produced an error on server. Look for its Fault_Response.xml in log folder."); + } + return report.Id; } } diff --git a/src/UsageExamples/ExampleCommon/CommonService/WeatherServiceEurope.cs b/src/UsageExamples/ExampleCommon/CommonService/WeatherServiceEurope.cs index 349ac99..7843f65 100644 --- a/src/UsageExamples/ExampleCommon/CommonService/WeatherServiceEurope.cs +++ b/src/UsageExamples/ExampleCommon/CommonService/WeatherServiceEurope.cs @@ -28,6 +28,12 @@ public virtual WeatherReport GetLastReportByLocation(string location) var lastReport = _reportRepository.GetLastByLocation(location); + if (lastReport == null) + { + Console.WriteLine("GetLastReport for " + location + ": null"); + return null; + } + Console.WriteLine("GetLastReport for " + location + ": returning Report ID = " + lastReport.Id); return lastReport; } diff --git a/src/UsageExamples/ExampleDelta/Client/App.config b/src/UsageExamples/ExampleDelta/Client/App.config index 6a6fd41..3889146 100644 --- a/src/UsageExamples/ExampleDelta/Client/App.config +++ b/src/UsageExamples/ExampleDelta/Client/App.config @@ -3,7 +3,7 @@ - diff --git a/src/UsageExamples/ExampleDelta/Client/Program.cs b/src/UsageExamples/ExampleDelta/Client/Program.cs index 61be2ff..0fa134a 100644 --- a/src/UsageExamples/ExampleDelta/Client/Program.cs +++ b/src/UsageExamples/ExampleDelta/Client/Program.cs @@ -16,8 +16,8 @@ private static void Main() var serviceClient = new WeatherServiceClient(); - serviceClient.ClientCredentials.UserName.UserName = "admin"; - serviceClient.ClientCredentials.UserName.Password = "password"; + serviceClient.ClientCredentials.UserName.UserName = "neo"; + serviceClient.ClientCredentials.UserName.Password = "matrix"; var randomDataClient = new RandomDataClient(serviceClient); randomDataClient.StartThreads(); diff --git a/src/UsageExamples/ExampleDelta/Service/App.config b/src/UsageExamples/ExampleDelta/Service/App.config index 064a575..18a0bc2 100644 --- a/src/UsageExamples/ExampleDelta/Service/App.config +++ b/src/UsageExamples/ExampleDelta/Service/App.config @@ -6,7 +6,7 @@ - + ().IncludeExceptionDetailInFaults = true; @@ -47,7 +47,7 @@ private static void Main() Console.WriteLine("Service started."); - Process.Start("http://localhost:5580/weatherService"); + Process.Start("http://localhost:5585/weatherServiceEpsilon"); Console.WriteLine("Press Enter to stop."); Console.ReadLine(); diff --git a/src/UsageExamples/ExampleGamma/Client/App.config b/src/UsageExamples/ExampleGamma/Client/App.config index c8957d2..8e3917b 100644 --- a/src/UsageExamples/ExampleGamma/Client/App.config +++ b/src/UsageExamples/ExampleGamma/Client/App.config @@ -3,7 +3,7 @@ - diff --git a/src/UsageExamples/ExampleGamma/Service/App.config b/src/UsageExamples/ExampleGamma/Service/App.config index 6bc5690..c33eb22 100644 --- a/src/UsageExamples/ExampleGamma/Service/App.config +++ b/src/UsageExamples/ExampleGamma/Service/App.config @@ -6,7 +6,7 @@ - +