diff --git a/.gitignore b/.gitignore index e30c054..ff76f06 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ Packages/ !NGeo.1.7.2.0.nupkg !NGeo.1.7.3.0.nupkg !NGeo.1.7.4.0.nupkg +!NGeo.1.7.5.0.nupkg #Ignore local testsettings Local.testsettings diff --git a/NGeo.Tests/Properties/AssemblyInfo.cs b/NGeo.Tests/Properties/AssemblyInfo.cs index 818b6db..c0694ac 100644 --- a/NGeo.Tests/Properties/AssemblyInfo.cs +++ b/NGeo.Tests/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("1.7.4.*")] +[assembly: AssemblyVersion("1.7.5.*")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NGeo/NGeo.nuspec b/NGeo/NGeo.nuspec index a105b93..88bd59a 100644 --- a/NGeo/NGeo.nuspec +++ b/NGeo/NGeo.nuspec @@ -17,7 +17,7 @@ NGeo is a client library that makes it easier to invoke GeoNames, Yahoo! GeoPlanet, and Yahoo! PlaceFinder services from .NET code. - Version 1.7.4 adds retry logic to the Geonames service when underlying connections are unexpectedly closed by the server. + Version 1.7.5 adds retry logic to the PlaceFinder service when ServiceModel.CommunicationException ("Server Error") exceptions are thrown. Copyright © UCosmic Consortium 2012 GeoNames, GeoPlanet, PlaceFinder, Yahoo diff --git a/NGeo/Properties/AssemblyInfo.cs b/NGeo/Properties/AssemblyInfo.cs index 18d4c0d..53d0b1a 100644 --- a/NGeo/Properties/AssemblyInfo.cs +++ b/NGeo/Properties/AssemblyInfo.cs @@ -35,6 +35,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.7.4.*")] +[assembly: AssemblyVersion("1.7.5.*")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/NGeo/Yahoo/PlaceFinder/PlaceFinderClient.cs b/NGeo/Yahoo/PlaceFinder/PlaceFinderClient.cs index e228a51..438af2c 100644 --- a/NGeo/Yahoo/PlaceFinder/PlaceFinderClient.cs +++ b/NGeo/Yahoo/PlaceFinder/PlaceFinderClient.cs @@ -29,7 +29,13 @@ private Response ChannelFindByCoordinates(PlaceByCoordinates request, int retry } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByCoordinates(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByCoordinates(request, ++retry); throw; } @@ -56,7 +62,13 @@ private Response ChannelFindByFreeformText(PlaceByFreeformText request, int retr } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByFreeformText(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByFreeformText(request, ++retry); throw; } @@ -83,7 +95,13 @@ private Response ChannelFindByName(PlaceByName request, int retry = 0) } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByName(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByName(request, ++retry); throw; } @@ -110,7 +128,13 @@ private Response ChannelFindByWoeId(PlaceByWoeId request, int retry = 0) } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByWoeId(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByWoeId(request, ++retry); throw; } @@ -138,7 +162,13 @@ private Response ChannelFindByMultilineAddress(PlaceByMultilineAddress request, } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByMultilineAddress(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByMultilineAddress(request, ++retry); throw; } @@ -168,7 +198,13 @@ private Response ChannelFindByFullyParsedAddress(PlaceByFullyParsedAddress reque } catch (ProtocolException ex) { - if (retry < RetryLimit && ex.InnerException != null && ex.InnerException is WebException) + if (retry < RetryLimit && ex.InnerException is WebException) + return ChannelFindByFullyParsedAddress(request, ++retry); + throw; + } + catch (CommunicationException ex) + { + if (retry < RetryLimit && ex.Message == "Server Error") return ChannelFindByFullyParsedAddress(request, ++retry); throw; } diff --git a/changelog.txt b/changelog.txt index 318d417..e2d5496 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +1.7.5 +- Add retry logic to PlaceFinder client when ServiceModel.CommunicationException ("Server Error") is thrown. + 1.7.4 - Add retry logic to Geonames client when underlying connection (expected to be kept alive) is unexpectedly closed by the server. diff --git a/nupkgs/NGeo.1.7.5.0.nupkg b/nupkgs/NGeo.1.7.5.0.nupkg new file mode 100644 index 0000000..b678399 Binary files /dev/null and b/nupkgs/NGeo.1.7.5.0.nupkg differ