Permalink
Browse files

touch files to fix remaining whitespace issues created from the origi…

…nal googecode / svn import
  • Loading branch information...
1 parent 48c0d23 commit e478df10594e3262539eb9cba93ab6b92215adf0 @mythz mythz committed Oct 14, 2012
Showing with 9,683 additions and 9,671 deletions.
  1. +4 −4 build/build.bat
  2. +384 −335 src/ServiceStack.Common/ServiceClient.Web/UrlExtensions.cs
  3. +14 −8 src/ServiceStack.Common/ServiceModel/Serialization/StringMapTypeDeserializer.cs
  4. +499 −499 src/ServiceStack.Common/ServiceStack.Common.csproj
  5. +173 −173 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/IndexOperationsControl.cs
  6. +237 −237 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/OperationControl.cs
  7. +86 −86 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/OperationsControl.cs
  8. +40 −40 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/Soap11OperationControl.cs
  9. +39 −39 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/Soap12OperationControl.cs
  10. +70 −70 src/ServiceStack/WebHost.Endpoints/Support/Metadata/WsdlMetadataHandlerBase.cs
  11. +8 −8 src/ServiceStack/WebHost.Endpoints/Support/Metadata/XsdTypeNames.cs
  12. +18 −18 src/ServiceStack/WebHost.Endpoints/Support/Metadata/XsdTypes.cs
  13. +84 −84 src/ServiceStack/WebHost.Endpoints/Support/Mocks/HttpRequestMock.cs
  14. +118 −118 src/ServiceStack/WebHost.Endpoints/Support/Mocks/HttpResponseMock.cs
  15. +94 −94 src/ServiceStack/WebHost.Endpoints/Support/RedirectHttpHandler.cs
  16. +174 −174 src/ServiceStack/WebHost.Endpoints/Support/RequestInfoHandler.cs
  17. +215 −215 src/ServiceStack/WebHost.Endpoints/Support/SoapHandler.cs
  18. +292 −292 src/ServiceStack/WebHost.Endpoints/Support/StaticFileHandler.cs
  19. +61 −61 src/ServiceStack/WebHost.Endpoints/Support/Templates/ListTemplate.cs
  20. +91 −91 src/ServiceStack/WebHost.Endpoints/Support/Templates/Soap11WsdlTemplate.cs
  21. +91 −91 src/ServiceStack/WebHost.Endpoints/Support/Templates/Soap12WsdlTemplate.cs
  22. +189 −189 src/ServiceStack/WebHost.Endpoints/Support/Templates/WsdlTemplateBase.cs
  23. +96 −96 src/ServiceStack/WebHost.Endpoints/Utils/FilterAttributeCache.cs
  24. +61 −61 src/ServiceStack/WebHost.Endpoints/Utils/XsdUtils.cs
  25. +20 −20 src/ServiceStack/WebHost.Endpoints/XmlSyncReplyHandler.cs
  26. +4 −4 src/packages/repositories.config
  27. +1 −1 tests/MasterHost/Global.asax
  28. +95 −95 tests/MasterHost/Global.asax.cs
  29. +158 −158 tests/MasterHost/MasterHost.csproj
  30. +35 −35 tests/MasterHost/Properties/AssemblyInfo.cs
  31. +73 −73 tests/MasterHost/ReportTests.cs
  32. +123 −123 tests/MasterHost/ReportsService.cs
  33. +163 −163 tests/MasterHost/RunReportsService.cs
  34. +151 −151 tests/MasterHost/RunRequestInfoService.cs
  35. +126 −126 tests/MasterHost/Web.config
  36. +9 −9 tests/MasterHost/default.htm
  37. +28 −28 tests/RazorRockstars.Console.Files/AppHost.cs
  38. +124 −124 tests/RazorRockstars.Console.Files/Benchmarks.cs
  39. +31 −31 tests/RazorRockstars.Console.Files/DynamicJsonTests.cs
  40. +167 −167 tests/RazorRockstars.Console.Files/MsgPackServiceTests.cs
  41. +225 −225 tests/RazorRockstars.Console.Files/RazorRockstars.Console.Files.csproj
  42. +235 −235 tests/RazorRockstars.Console.Files/RazorRockstars_FilesTests.cs
  43. +1 −4 tests/RazorRockstars.Console.Files/ReqStarsService.cs
  44. +48 −48 tests/RazorRockstars.Console.Files/Web.config
  45. +17 −17 tests/RazorRockstars.Console/AppHost.cs
  46. +144 −144 tests/RazorRockstars.Console/RazorRockstars.Console.csproj
  47. +155 −155 tests/RazorRockstars.Console/RazorRockstars_EmbeddedFilesTests.cs
  48. +48 −48 tests/RazorRockstars.Console/Web.config
  49. +1 −1 tests/RazorRockstars.Web/Global.asax
  50. +12 −12 tests/RazorRockstars.Web/Global.asax.cs
  51. +35 −35 tests/RazorRockstars.Web/Properties/AssemblyInfo.cs
  52. +179 −179 tests/RazorRockstars.Web/RazorRockstars_WebTests.cs
  53. +70 −70 tests/RazorRockstars.Web/Web.config
  54. +25 −25 tests/ServiceStack.Auth.Tests/App.config
  55. +176 −176 tests/ServiceStack.Auth.Tests/RazorAppHost.cs
  56. +3 −3 tests/ServiceStack.Auth.Tests/SecureTests.cs
  57. +109 −109 tests/ServiceStack.Auth.Tests/ServiceStack.Auth.Tests.csproj
  58. +31 −31 tests/ServiceStack.Auth.Tests/TestBase.cs
  59. +117 −117 tests/ServiceStack.Common.Tests/IdUtilsTests.cs
  60. +150 −150 tests/ServiceStack.Common.Tests/MappingTests.cs
  61. +60 −60 tests/ServiceStack.Common.Tests/MessagingTests.cs
  62. +183 −183 tests/ServiceStack.Common.Tests/Models/ModelWithFieldsOfDifferentTypes.cs
  63. +84 −84 tests/ServiceStack.Common.Tests/OAuth/CredentialsServiceTests.cs
  64. +57 −57 tests/ServiceStack.Common.Tests/OAuth/MockAuthHttpGateway.cs
  65. +316 −316 tests/ServiceStack.Common.Tests/OAuth/OAuthUserSessionTests.cs
  66. +243 −243 tests/ServiceStack.Common.Tests/OAuth/OAuthUserSessionTestsBase.cs
  67. +96 −96 tests/ServiceStack.Common.Tests/OAuth/OAuthUserSessionWithoutTestSourceTests.cs
  68. +53 −53 tests/ServiceStack.Common.Tests/OAuth/OrmLiteUserAuthTests.cs
  69. +145 −145 tests/ServiceStack.Common.Tests/OAuth/RegistrationServiceTests.cs
  70. +82 −82 tests/ServiceStack.Common.Tests/OAuth/RequiredRolesTests.cs
  71. +5 −5 tests/ServiceStack.Common.Tests/Perf/TextSerializerComparisons.cs
  72. +109 −109 tests/ServiceStack.Common.Tests/PerfTestBase.cs
  73. +37 −37 tests/ServiceStack.Common.Tests/Properties/Settings.Designer.cs
  74. +81 −81 tests/ServiceStack.Common.Tests/ReflectionExtensionsTests.cs
  75. +264 −264 tests/ServiceStack.Common.Tests/ReflectionUtilTests.cs
  76. +258 −258 tests/ServiceStack.Common.Tests/ServiceStack.Common.Tests.csproj
  77. +75 −75 tests/ServiceStack.Common.Tests/StreamExtensionsTests.cs
  78. +6 −6 tests/ServiceStack.Common.Tests/StringExtensionTests.cs
  79. +76 −76 tests/ServiceStack.Common.Tests/Text/AdhocJsTests.cs
  80. +0 −40 tests/ServiceStack.Common.Tests/UrlExtensionTests.cs
  81. +9 −9 tests/ServiceStack.Common.Tests/app.config
  82. +93 −93 tests/ServiceStack.Messaging.Tests/MessageSerializationTests.cs
  83. +152 −152 tests/ServiceStack.Messaging.Tests/ServiceStack.Messaging.Tests.csproj
  84. +9 −9 tests/ServiceStack.Messaging.Tests/Services/MessagingServiceBase.cs
  85. +122 −122 tests/ServiceStack.Messaging.Tests/TransientServiceMessagingTests.cs
  86. +1 −1 tests/ServiceStack.RazorHostTests/Global.asax
  87. +171 −171 tests/ServiceStack.RazorHostTests/Global.asax.cs
  88. +35 −35 tests/ServiceStack.RazorHostTests/Properties/AssemblyInfo.cs
  89. +214 −214 tests/ServiceStack.RazorHostTests/ServiceStack.RazorHostTests.csproj
  90. +29 −29 tests/ServiceStack.RazorHostTests/Web.Debug.config
  91. +30 −30 tests/ServiceStack.RazorHostTests/Web.Release.config
  92. +57 −57 tests/ServiceStack.RazorHostTests/Web.config
  93. +1 −1 tests/ServiceStack.RazorNancyTests/Global.asax
  94. +54 −54 tests/ServiceStack.RazorNancyTests/Global.asax.cs
  95. +35 −35 tests/ServiceStack.RazorNancyTests/Properties/AssemblyInfo.cs
  96. +128 −128 tests/ServiceStack.RazorNancyTests/ServiceStack.RazorNancyTests.csproj
  97. +35 −35 tests/ServiceStack.RazorNancyTests/Web.config
  98. +5 −5 tests/ServiceStack.RazorNancyTests/packages.config
  99. +27 −27 tests/ServiceStack.ServiceHost.Tests/App.config
  100. +19 −19 tests/ServiceStack.ServiceHost.Tests/AppData/FormatHelpers.cs
Sorry, we could not display the entire diff because it was too big.
View
8 build/build.bat
@@ -17,10 +17,10 @@ COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.dll ..\NuGet\
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.pdb ..\NuGet\ServiceStack\lib\net35
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.xml ..\NuGet\ServiceStack\lib\net35
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.ServiceInterface.* ..\NuGet\ServiceStack\lib\net35
-REM COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.dll ..\NuGet\ServiceStack\lib\net40
-REM COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.pdb ..\NuGet\ServiceStack\lib\net40
-REM COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.xml ..\NuGet\ServiceStack\lib\net40
-REM COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.ServiceInterface.* ..\NuGet\ServiceStack\lib\net40
+COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.dll ..\NuGet\ServiceStack\lib\net40
+COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.pdb ..\NuGet\ServiceStack\lib\net40
+COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.xml ..\NuGet\ServiceStack\lib\net40
+COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.ServiceInterface.* ..\NuGet\ServiceStack\lib\net40
COPY ..\src\ServiceStack.Razor\bin\%BUILD%\ServiceStack.Razor.* ..\NuGet\ServiceStack.Razor\lib\net40
COPY ..\src\ServiceStack.ServiceInterface\bin\%BUILD%\ServiceStack.Common.* ..\NuGet\ServiceStack.Common\lib\net35
View
719 src/ServiceStack.Common/ServiceClient.Web/UrlExtensions.cs
@@ -1,336 +1,385 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Reflection;
-using ServiceStack.Net30.Collections.Concurrent;
-using ServiceStack.ServiceHost;
-using ServiceStack.Text;
-
-namespace ServiceStack.ServiceClient.Web
-{
- /// <summary>
- /// Donated by Ivan Korneliuk from his post:
- /// http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html
- ///
- /// Modified to only allow using routes matching the supplied HTTP Verb
- /// </summary>
- public static class UrlExtensions
- {
- private static readonly ConcurrentDictionary<Type, List<RestRoute>> routesCache =
- new ConcurrentDictionary<Type, List<RestRoute>>();
-
- public static string ToUrl(this IReturn request, string httpMethod, string formatFallbackToPredefinedRoute=null)
- {
- httpMethod = httpMethod.ToUpper();
-
- var requestType = request.GetType();
- var requestRoutes = routesCache.GetOrAdd(requestType, GetRoutesForType);
- if (!requestRoutes.Any())
- {
- if (formatFallbackToPredefinedRoute == null)
- throw new InvalidOperationException("There is no rest routes mapped for '{0}' type. ".Fmt(requestType)
- + "(Note: The automatic route selection only works with [Route] attributes on the request DTO and"
- + "not with routes registered in the IAppHost!)");
-
- var predefinedRoute = "/{0}/syncreply/{1}".Fmt(formatFallbackToPredefinedRoute, request.GetType().Name);
- if (httpMethod == "GET" || httpMethod == "DELETE" || httpMethod == "OPTIONS")
- {
- var queryString = "?{0}".Fmt(request.GetType().GetProperties().ToQueryString(request));
- predefinedRoute += queryString;
- }
-
- return predefinedRoute;
- }
-
- var routesApplied =
- requestRoutes.Select(route => new { Route = route, Result = route.Apply(request, httpMethod) }).ToList();
- var matchingRoutes = routesApplied.Where(x => x.Result.Matches).ToList();
- if (!matchingRoutes.Any())
- {
- var errors = string.Join(String.Empty, routesApplied.Select(x => "\r\n\t{0}:\t{1}".Fmt(x.Route.Path, x.Result.FailReason)).ToArray());
- var errMsg = "None of the given rest routes matches '{0}' request:{1}"
- .Fmt(requestType.Name, errors);
-
- throw new InvalidOperationException(errMsg);
- }
-
- var matchingRoute = matchingRoutes[0]; // hack to determine variable type.
- if (matchingRoutes.Count > 1)
- {
- var mostSpecificRoute = FindMostSpecificRoute(matchingRoutes.Select(x => x.Route));
- if (mostSpecificRoute == null)
- {
- var errors = String.Join(String.Empty, matchingRoutes.Select(x => "\r\n\t" + x.Route.Path).ToArray());
- var errMsg = "Ambiguous matching routes found for '{0}' request:{1}".Fmt(requestType.Name, errors);
- throw new InvalidOperationException(errMsg);
- }
-
- matchingRoute = matchingRoutes.Single(x => x.Route == mostSpecificRoute);
- }
- else
- {
- matchingRoute = matchingRoutes.Single();
- }
-
- var url = matchingRoute.Result.Uri;
- if (httpMethod == HttpMethod.Get || httpMethod == HttpMethod.Delete)
- {
- var queryParams = matchingRoute.Route.FormatQueryParameters(request);
- if (!String.IsNullOrEmpty(queryParams))
- {
- url += "?" + queryParams;
- }
- }
-
- return url;
- }
-
- private static List<RestRoute> GetRoutesForType(Type requestType)
- {
- var restRoutes = requestType.GetCustomAttributes(false)
- .OfType<RouteAttribute>()
- .Select(attr => new RestRoute(requestType, attr.Path, attr.Verbs))
- .ToList();
-
- return restRoutes;
- }
-
- private static RestRoute FindMostSpecificRoute(IEnumerable<RestRoute> routes)
- {
- routes = routes.ToList();
- var mostSpecificRoute = routes.OrderBy(p => p.Variables.Count).Last();
-
- // We may find several different routes {code}/{id} and {code}/{name} having the same number of variables.
- // Such case will be handled by the next check.
- var allPathesAreSubsetsOfMostSpecific = routes
- .All(route => !route.Variables.Except(mostSpecificRoute.Variables).Any());
- if (!allPathesAreSubsetsOfMostSpecific)
- {
- return null;
- }
-
- // Choose
- // /product-lines/{productId}/{lineNumber}
- // over
- // /products/{productId}/product-lines/{lineNumber}
- // (shortest one)
- var shortestPath = routes
- .Where(p => p.Variables.Count == mostSpecificRoute.Variables.Count)
- .OrderBy(path => path.Path.Length)
- .First();
-
- return shortestPath;
- }
-
- public static string ToQueryString(this IEnumerable<PropertyInfo> propertyInfos, object request)
- {
- var parameters = String.Empty;
- foreach (var property in propertyInfos)
- {
- var value = property.GetValue(request, null);
- if (value == null)
- {
- continue;
- }
- parameters += "&{0}={1}".Fmt(property.Name.ToCamelCase(), RestRoute.FormatQueryParameterValue(value));
- }
- if (!String.IsNullOrEmpty(parameters))
- {
- parameters = parameters.Substring(1);
- }
- return parameters;
- }
- }
-
- public class RestRoute
- {
- static char[] ArrayBrackets = new[]{'[',']'};
-
- public static string FormatValue(object value)
- {
- var jsv = value.ToJsv().Trim(ArrayBrackets);
- return jsv;
- }
-
- [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Using field is just easier.")]
- public static Func<object, string> FormatVariable = value => {
- var valueString = value as string;
- return valueString != null ? Uri.EscapeDataString(valueString) : FormatValue(value);
- };
-
- [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Using field is just easier.")]
- public static Func<object, string> FormatQueryParameterValue = value => {
- // Perhaps custom formatting needed for DateTimes, lists, etc.
- var valueString = value as string;
- return valueString != null ? Uri.EscapeDataString(valueString) : FormatValue(value);
- };
-
- private const char PathSeparatorChar = '/';
- private const string VariablePrefix = "{";
- private const char VariablePrefixChar = '{';
- private const string VariablePostfix = "}";
- private const char VariablePostfixChar = '}';
-
- private readonly Dictionary<string, PropertyInfo> variablesMap = new Dictionary<string, PropertyInfo>();
-
- public RestRoute(Type type, string path, string verbs)
- {
- this.HttpMethods = (verbs ?? string.Empty).Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
- this.Type = type;
- this.Path = path;
-
- this.MapUrlVariablesToProperties();
- this.Variables = this.variablesMap.Keys.Select(x => x.ToLowerInvariant()).Distinct().ToList().AsReadOnly();
- }
-
- public string ErrorMsg { get; set; }
-
- public Type Type { get; set; }
-
- public bool IsValid
- {
- get { return string.IsNullOrEmpty(this.ErrorMsg); }
- }
-
- public string Path { get; set; }
-
- public string[] HttpMethods { get; private set; }
-
- public IList<string> Variables { get; set; }
-
- public RouteResolutionResult Apply(object request, string httpMethod)
- {
- if (!this.IsValid)
- {
- return RouteResolutionResult.Error(this.ErrorMsg);
- }
-
- if (HttpMethods != null && HttpMethods.Length != 0 && httpMethod != null && !HttpMethods.Contains(httpMethod) && !HttpMethods.Contains("ANY"))
- {
- return RouteResolutionResult.Error("Allowed HTTP methods '{0}' does not support the specified '{1}' method."
- .Fmt(HttpMethods.Join(", "), httpMethod));
- }
-
- var uri = this.Path;
-
- var unmatchedVariables = new List<string>();
- foreach (var variable in this.variablesMap)
- {
- var property = variable.Value;
- var value = property.GetValue(request, null);
- if (value == null)
- {
- unmatchedVariables.Add(variable.Key);
- continue;
- }
-
- var variableValue = FormatVariable(value);
- uri = uri.Replace(VariablePrefix + variable.Key + VariablePostfix, variableValue);
- }
-
- if (unmatchedVariables.Any())
- {
- var errMsg = "Could not match following variables: " + string.Join(",", unmatchedVariables.ToArray());
- return RouteResolutionResult.Error(errMsg);
- }
-
- return RouteResolutionResult.Success(uri);
- }
-
- public string FormatQueryParameters(object request)
- {
- var propertyInfos = this.Type.GetProperties().Except(this.variablesMap.Values);
-
- var parameters = propertyInfos.ToQueryString(request);
-
- return parameters;
- }
-
- private void MapUrlVariablesToProperties()
- {
- // Perhaps other filters needed: do not include indexers, property should have public getter, etc.
- var properties = this.Type.GetProperties(BindingFlags.Instance | BindingFlags.Public);
-
- var components = this.Path.Split(PathSeparatorChar);
- foreach (var component in components)
- {
- if (string.IsNullOrEmpty(component))
- {
- continue;
- }
-
- if (component.Contains(VariablePrefix) || component.Contains(VariablePostfix))
- {
- var variableName = component.Substring(1, component.Length - 2);
-
- // Accept only variables matching this format: '/{property}/'
- // Incorrect formats: '/{property/' or '/{property}-some-other-text/'
- // I'm not sure that the second one will be parsed correctly at server side.
- if (component[0] != VariablePrefixChar || component[component.Length - 1] != VariablePostfixChar || variableName.Contains(VariablePostfix))
- {
- this.AppendError("Component '{0}' can not be parsed".Fmt(component));
- continue;
- }
-
- if (!this.variablesMap.ContainsKey(variableName))
- {
- var matchingProperties = properties
- .Where(p => p.Name.Equals(variableName, StringComparison.OrdinalIgnoreCase))
- .ToList();
-
- if (!matchingProperties.Any())
- {
- this.AppendError("Variable '{0}' does not match any property.".Fmt(variableName));
- continue;
- }
-
- if (matchingProperties.Count > 1)
- {
- var msg = "Variable '{0}' matches '{1}' properties which are differ by case only."
- .Fmt(variableName, matchingProperties.Count);
- this.AppendError(msg);
- continue;
- }
-
- this.variablesMap.Add(variableName, matchingProperties.Single());
- }
- }
- }
- }
-
- private void AppendError(string msg)
- {
- if (string.IsNullOrEmpty(this.ErrorMsg))
- {
- this.ErrorMsg = msg;
- }
- else
- {
- this.ErrorMsg += "\r\n" + msg;
- }
- }
-
- public class RouteResolutionResult
- {
- public string FailReason { get; private set; }
-
- public string Uri { get; private set; }
-
- public bool Matches
- {
- get { return string.IsNullOrEmpty(this.FailReason); }
- }
-
- public static RouteResolutionResult Error(string errorMsg)
- {
- return new RouteResolutionResult { FailReason = errorMsg };
- }
-
- public static RouteResolutionResult Success(string uri)
- {
- return new RouteResolutionResult { Uri = uri };
- }
- }
- }
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Linq;
+using System.Reflection;
+using System.Runtime.Serialization;
+using System.Text;
+using ServiceStack.Net30.Collections.Concurrent;
+using ServiceStack.ServiceHost;
+using ServiceStack.Text;
+
+namespace ServiceStack.ServiceClient.Web
+{
+ /// <summary>
+ /// Donated by Ivan Korneliuk from his post:
+ /// http://korneliuk.blogspot.com/2012/08/servicestack-reusing-dtos.html
+ ///
+ /// Modified to only allow using routes matching the supplied HTTP Verb
+ /// </summary>
+ public static class UrlExtensions
+ {
+ private static readonly ConcurrentDictionary<Type, List<RestRoute>> routesCache =
+ new ConcurrentDictionary<Type, List<RestRoute>>();
+
+ public static string ToUrl(this IReturn request, string httpMethod, string formatFallbackToPredefinedRoute=null)
+ {
+ httpMethod = httpMethod.ToUpper();
+
+ var requestType = request.GetType();
+ var requestRoutes = routesCache.GetOrAdd(requestType, GetRoutesForType);
+ if (requestRoutes.Count == 0)
+ {
+ if (formatFallbackToPredefinedRoute == null)
+ throw new InvalidOperationException("There are no rest routes mapped for '{0}' type. ".Fmt(requestType)
+ + "(Note: The automatic route selection only works with [Route] attributes on the request DTO and"
+ + "not with routes registered in the IAppHost!)");
+
+ var predefinedRoute = "/{0}/syncreply/{1}".Fmt(formatFallbackToPredefinedRoute, requestType.Name);
+ if (httpMethod == "GET" || httpMethod == "DELETE" || httpMethod == "OPTIONS")
+ {
+ var queryProperties = RestRoute.GetQueryProperties(request.GetType());
+ predefinedRoute += "?" + RestRoute.GetQueryString(request, queryProperties);
+ }
+
+ return predefinedRoute;
+ }
+
+ var routesApplied = requestRoutes.Select(route => route.Apply(request, httpMethod)).ToList();
+ var matchingRoutes = routesApplied.Where(x => x.Matches).ToList();
+ if (matchingRoutes.Count == 0)
+ {
+ var errors = string.Join(String.Empty, routesApplied.Select(x => "\r\n\t{0}:\t{1}".Fmt(x.Route.Path, x.FailReason)).ToArray());
+ var errMsg = "None of the given rest routes matches '{0}' request:{1}"
+ .Fmt(requestType.Name, errors);
+
+ throw new InvalidOperationException(errMsg);
+ }
+
+ RouteResolutionResult matchingRoute;
+ if (matchingRoutes.Count > 1)
+ {
+ matchingRoute = FindMostSpecificRoute(matchingRoutes);
+ if (matchingRoute == null)
+ {
+ var errors = String.Join(String.Empty, matchingRoutes.Select(x => "\r\n\t" + x.Route.Path).ToArray());
+ var errMsg = "Ambiguous matching routes found for '{0}' request:{1}".Fmt(requestType.Name, errors);
+ throw new InvalidOperationException(errMsg);
+ }
+ }
+ else
+ {
+ matchingRoute = matchingRoutes[0];
+ }
+
+ var url = matchingRoute.Uri;
+ if (httpMethod == HttpMethod.Get || httpMethod == HttpMethod.Delete)
+ {
+ var queryParams = matchingRoute.Route.FormatQueryParameters(request);
+ if (!String.IsNullOrEmpty(queryParams))
+ {
+ url += "?" + queryParams;
+ }
+ }
+
+ return url;
+ }
+
+ private static List<RestRoute> GetRoutesForType(Type requestType)
+ {
+ var restRoutes = requestType.GetCustomAttributes(false)
+ .OfType<RouteAttribute>()
+ .Select(attr => new RestRoute(requestType, attr.Path, attr.Verbs))
+ .ToList();
+
+ return restRoutes;
+ }
+
+ private static RouteResolutionResult FindMostSpecificRoute(IEnumerable<RouteResolutionResult> routes)
+ {
+ RouteResolutionResult bestMatch = default(RouteResolutionResult);
+ var otherMatches = new List<RouteResolutionResult>();
+
+ foreach (var route in routes)
+ {
+ if (bestMatch == null)
+ {
+ bestMatch = route;
+ }
+ else if (route.VariableCount > bestMatch.VariableCount)
+ {
+ otherMatches.Clear();
+ bestMatch = route;
+ }
+ else if (route.VariableCount == bestMatch.VariableCount)
+ {
+ // Choose
+ // /product-lines/{productId}/{lineNumber}
+ // over
+ // /products/{productId}/product-lines/{lineNumber}
+ // (shortest one)
+ if (route.PathLength < bestMatch.PathLength)
+ {
+ otherMatches.Add(bestMatch);
+ bestMatch = route;
+ }
+ else
+ {
+ otherMatches.Add(route);
+ }
+ }
+ }
+
+ // We may find several different routes {code}/{id} and {code}/{name} having the same number of variables.
+ // Such case will be handled by the next check.
+ return bestMatch == null || otherMatches.All(r => r.HasSameVariables(bestMatch))
+ ? bestMatch
+ : null;
+ }
+ }
+
+ public class RestRoute
+ {
+ private static readonly char[] ArrayBrackets = new[]{ '[' , ']' };
+
+ private static string FormatValue(object value)
+ {
+ var jsv = value.ToJsv().Trim(ArrayBrackets);
+ return jsv;
+ }
+
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Using field is just easier.")]
+ public static Func<object, string> FormatVariable = value => {
+ var valueString = value as string;
+ return valueString != null ? Uri.EscapeDataString(valueString) : FormatValue(value);
+ };
+
+ [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Using field is just easier.")]
+ public static Func<object, string> FormatQueryParameterValue = value => {
+ // Perhaps custom formatting needed for DateTimes, lists, etc.
+ var valueString = value as string;
+ return valueString != null ? Uri.EscapeDataString(valueString) : FormatValue(value);
+ };
+
+ private const char PathSeparatorChar = '/';
+ private const string VariablePrefix = "{";
+ private const char VariablePrefixChar = '{';
+ private const string VariablePostfix = "}";
+ private const char VariablePostfixChar = '}';
+
+ private readonly IDictionary<string, PropertyInfo> queryProperties;
+ private readonly IDictionary<string, PropertyInfo> variablesMap = new Dictionary<string, PropertyInfo>(StringComparer.InvariantCultureIgnoreCase);
+
+ public RestRoute(Type type, string path, string verbs)
+ {
+ this.HttpMethods = (verbs ?? string.Empty).Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
+ this.Type = type;
+ this.Path = path;
+
+ this.queryProperties = GetQueryProperties(type);
+ foreach (var variableName in GetUrlVariables(path))
+ {
+ PropertyInfo propertyInfo;
+ if (!this.queryProperties.TryGetValue(variableName, out propertyInfo))
+ {
+ this.AppendError("Variable '{0}' does not match any property.".Fmt(variableName));
+ continue;
+ }
+
+ this.variablesMap[variableName] = propertyInfo;
+ this.queryProperties.Remove(variableName);
+ }
+ }
+
+ public string ErrorMsg { get; private set; }
+
+ public Type Type { get; private set; }
+
+ public bool IsValid
+ {
+ get { return string.IsNullOrEmpty(this.ErrorMsg); }
+ }
+
+ public string Path { get; private set; }
+
+ public string[] HttpMethods { get; private set; }
+
+ public ICollection<string> Variables
+ {
+ get { return this.variablesMap.Keys; }
+ }
+
+ public RouteResolutionResult Apply(object request, string httpMethod)
+ {
+ if (!this.IsValid)
+ {
+ return RouteResolutionResult.Error(this, this.ErrorMsg);
+ }
+
+ if (HttpMethods != null && HttpMethods.Length != 0 && httpMethod != null && !HttpMethods.Contains(httpMethod) && !HttpMethods.Contains("ANY"))
+ {
+ return RouteResolutionResult.Error(this, "Allowed HTTP methods '{0}' does not support the specified '{1}' method."
+ .Fmt(HttpMethods.Join(", "), httpMethod));
+ }
+
+ var uri = this.Path;
+
+ var unmatchedVariables = new List<string>();
+ foreach (var variable in this.variablesMap)
+ {
+ var property = variable.Value;
+ var value = property.GetValue(request, null);
+ if (value == null)
+ {
+ unmatchedVariables.Add(variable.Key);
+ continue;
+ }
+
+ var variableValue = FormatVariable(value);
+ uri = uri.Replace(VariablePrefix + variable.Key + VariablePostfix, variableValue);
+ }
+
+ if (unmatchedVariables.Any())
+ {
+ var errMsg = "Could not match following variables: " + string.Join(",", unmatchedVariables.ToArray());
+ return RouteResolutionResult.Error(this, errMsg);
+ }
+
+ return RouteResolutionResult.Success(this, uri);
+ }
+
+ public string FormatQueryParameters(object request)
+ {
+ return GetQueryString(request, this.queryProperties);
+ }
+
+ internal static string GetQueryString(object request, IDictionary<string, PropertyInfo> propertyMap)
+ {
+ var result = new StringBuilder();
+
+ foreach (var queryProperty in propertyMap)
+ {
+ var value = queryProperty.Value.GetValue(request, null);
+ if (value == null)
+ {
+ continue;
+ }
+
+ result.Append(queryProperty.Key)
+ .Append('=')
+ .Append(RestRoute.FormatQueryParameterValue(value))
+ .Append('&');
+ }
+
+ if (result.Length > 0) result.Length -= 1;
+ return result.ToString();
+ }
+
+ internal static IDictionary<string, PropertyInfo> GetQueryProperties(Type requestType)
+ {
+ var result = new Dictionary<string, PropertyInfo>(StringComparer.InvariantCultureIgnoreCase);
+ var hasDataContract = requestType.HasAttr<DataContractAttribute>();
+
+ foreach (var propertyInfo in requestType.GetProperties(BindingFlags.Instance | BindingFlags.Public))
+ {
+ var propertyName = propertyInfo.Name;
+
+ if (!propertyInfo.CanRead) continue;
+ if (hasDataContract)
+ {
+ if (!propertyInfo.IsDefined(typeof(DataMemberAttribute), true)) continue;
+ var dataMember = (DataMemberAttribute)propertyInfo.GetCustomAttributes(typeof(DataMemberAttribute), true)[0];
+ if (!string.IsNullOrEmpty(dataMember.Name))
+ {
+ propertyName = dataMember.Name;
+ }
+ }
+ else
+ {
+ if (propertyInfo.IsDefined(typeof(IgnoreDataMemberAttribute), true)) continue;
+ }
+
+ result[propertyName.ToCamelCase()] = propertyInfo;
+ }
+
+ return result;
+ }
+
+ private IEnumerable<string> GetUrlVariables(string path)
+ {
+ var components = path.Split(PathSeparatorChar);
+ foreach (var component in components)
+ {
+ if (string.IsNullOrEmpty(component))
+ {
+ continue;
+ }
+
+ if (component.Contains(VariablePrefix) || component.Contains(VariablePostfix))
+ {
+ var variableName = component.Substring(1, component.Length - 2);
+
+ // Accept only variables matching this format: '/{property}/'
+ // Incorrect formats: '/{property/' or '/{property}-some-other-text/'
+ // I'm not sure that the second one will be parsed correctly at server side.
+ if (component[0] != VariablePrefixChar || component[component.Length - 1] != VariablePostfixChar || variableName.Contains(VariablePostfix))
+ {
+ this.AppendError("Component '{0}' can not be parsed".Fmt(component));
+ continue;
+ }
+
+ yield return variableName;
+ }
+ }
+ }
+
+ private void AppendError(string msg)
+ {
+ if (string.IsNullOrEmpty(this.ErrorMsg))
+ {
+ this.ErrorMsg = msg;
+ }
+ else
+ {
+ this.ErrorMsg += "\r\n" + msg;
+ }
+ }
+ }
+
+ public class RouteResolutionResult
+ {
+ public string FailReason { get; private set; }
+ public string Uri { get; private set; }
+ public RestRoute Route { get; private set; }
+
+ public bool Matches
+ {
+ get { return string.IsNullOrEmpty(this.FailReason); }
+ }
+
+ public static RouteResolutionResult Error(RestRoute route, string errorMsg)
+ {
+ return new RouteResolutionResult { Route = route, FailReason = errorMsg };
+ }
+
+ public static RouteResolutionResult Success(RestRoute route, string uri)
+ {
+ return new RouteResolutionResult { Route = route, Uri = uri };
+ }
+
+ internal int VariableCount
+ {
+ get { return Route.Variables.Count; }
+ }
+
+ internal int PathLength
+ {
+ get { return Route.Path.Length; }
+ }
+
+ internal bool HasSameVariables(RouteResolutionResult other)
+ {
+ return Route.Variables.All(v => other.Route.Variables.Contains(v));
+ }
+ }
}
View
22 src/ServiceStack.Common/ServiceModel/Serialization/StringMapTypeDeserializer.cs
@@ -41,9 +41,9 @@ public StringMapTypeDeserializer(Type type)
foreach (var propertyInfo in type.GetSerializableProperties())
{
var propertySetFn = JsvDeserializeType.GetSetPropertyMethod(type, propertyInfo);
- var propertyType = propertyInfo.PropertyType;
- var propertyParseStringFn = JsvReader.GetParseFn(propertyType);
- var propertySerializer = new PropertySerializerEntry(propertySetFn, propertyParseStringFn) { PropertyType = propertyType };
+ var propertyType = propertyInfo.PropertyType;
+ var propertyParseStringFn = JsvReader.GetParseFn(propertyType);
+ var propertySerializer = new PropertySerializerEntry(propertySetFn, propertyParseStringFn) { PropertyType = propertyType };
var attr = propertyInfo.FirstAttribute<DataMemberAttribute>();
if (attr != null && attr.Name != null)
@@ -57,17 +57,17 @@ public StringMapTypeDeserializer(Type type)
public object PopulateFromMap(object instance, IDictionary<string, string> keyValuePairs)
{
string propertyName = null;
- string propertyTextValue = null;
- PropertySerializerEntry propertySerializerEntry = null;
+ string propertyTextValue = null;
+ PropertySerializerEntry propertySerializerEntry = null;
try
{
if (instance == null) instance = type.CreateInstance();
foreach (var pair in keyValuePairs)
{
- propertyName = pair.Key;
- propertyTextValue = pair.Value;
+ propertyName = pair.Key;
+ propertyTextValue = pair.Value;
if (!propertySetterMap.TryGetValue(propertyName, out propertySerializerEntry))
{
@@ -78,6 +78,12 @@ public object PopulateFromMap(object instance, IDictionary<string, string> keyVa
continue;
}
+ if (propertySerializerEntry.PropertySetFn == null)
+ {
+ Log.WarnFormat("Could not set value of read-only property '{0}' on type '{1}'", propertyName, type.FullName);
+ continue;
+ }
+
var value = propertySerializerEntry.PropertyParseStringFn(propertyTextValue);
if (value == null)
{
@@ -102,7 +108,7 @@ public object PopulateFromMap(object instance, IDictionary<string, string> keyVa
if (propertySerializerEntry != null && propertySerializerEntry.PropertyType != null) {
serializationException.Data.Add("propertyType", propertySerializerEntry.PropertyType);
}
- throw serializationException;
+ throw serializationException;
}
}
View
998 src/ServiceStack.Common/ServiceStack.Common.csproj
@@ -1,500 +1,500 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{982416DB-C143-4028-A0C3-CF41892D18D3}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>ServiceStack.Common</RootNamespace>
- <AssemblyName>ServiceStack.Common</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <FileUpgradeFlags>
- </FileUpgradeFlags>
- <OldToolsVersion>3.5</OldToolsVersion>
- <UpgradeBackupLocation />
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>False</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>True</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- <DocumentationFile>bin\Release\ServiceStack.Common.XML</DocumentationFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'STATIC_ONLY NO_EXPRESSIONS|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <OutputPath>bin\MonoTouch\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <Optimize>False</Optimize>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MonoTouch|AnyCPU' ">
- <DebugSymbols>True</DebugSymbols>
- <OutputPath>bin\MonoTouch\</OutputPath>
- <DefineConstants>TRACE;DEBUG;MONOTOUCH</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>AnyCPU</PlatformTarget>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <Optimize>False</Optimize>
- <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Data" />
- <Reference Include="System.Runtime.Serialization" />
- <Reference Include="System.ServiceModel" />
- <Reference Include="System.ServiceModel.Web" />
- <Reference Include="System.Web" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Xml.Linq">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="ServiceStack.Text">
- <HintPath>..\..\lib\ServiceStack.Text.dll</HintPath>
- </Reference>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="ActionExecExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="AssertExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ByteArrayExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DictionaryExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DirectoryInfoExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="DisposableExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="EnumerableExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="EnumExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ExecExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Expressions\DelegateFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\ActionExecExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\AssertExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\ByteArrayExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\CollectionExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\DictionaryExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\EnumerableExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\IntExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\ITranslatorExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\ReflectionExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Extensions\StringExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="HostContext.cs" />
- <Compile Include="IntExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="IPAddressExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\ClientFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\IMessageHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\IMessageHandlerDisposer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\IMessageHandlerFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\InMemoryMessageQueueClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\InMemoryTransientMessageFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\InMemoryTransientMessageService.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\MessageExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\MessageHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\MessageHandlerFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\MessageQueueClientFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\Rcon\Client.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\Rcon\Packet.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\Rcon\PacketCodec.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\Rcon\PacketProcessingClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\Rcon\Server.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Messaging\TransientMessageServiceBase.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Model.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ModelConfig.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Net30\ConcurrentDictionary.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Net30\ConcurrentQueue.cs" />
- <Compile Include="Net30\ObjectPool.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Net30\SplitOrderedList.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Net30\Tuple.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="ReflectionExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Reflection\PropertyAccessor.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Reflection\StaticAccessors.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\AsyncServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\AuthDtos.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\DictionaryExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\GenericProxy.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\HttpMethod.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\IDuplex.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\IDuplexCallback.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\IOneWay.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\ISyncReply.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\IWcfServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\JsonRestClientAsync.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\JsonServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\JsvRestClientAsync.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\JsvServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\ServiceClientBase.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\Soap11ServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\Soap12ServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\UrlExtensions.cs" />
- <Compile Include="ServiceClient.Web\WcfServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\WebRequestExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\WebRequestUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\WebServiceException.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\XLinqExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\XmlRestClientAsync.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceClient.Web\XmlServiceClient.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\DictionaryExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\DataContractDeserializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\DataContractSerializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\JsonDataContractDeserializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\JsonDataContractSerializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\KeyValueDataContractDeserializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\StringMapTypeDeserializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\XmlSerializableDeserializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Serialization\XmlSerializableSerializer.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Support\XmlSerializableWrapper.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Validation\ValidationError.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Validation\ValidationErrorField.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\Validation\ValidationErrorResult.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="ServiceModel\XLinqExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="StreamExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="StringExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\ActionExecHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\AdapterBase.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\AssignmentDefinition.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\CommandExecsHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\CommandResultsHandler.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\InMemoryLogFactory.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\LogicFacadeBase.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\NetDeflateProvider.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\NetGZipProvider.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Support\PropertyInvoker.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="TypeExtensions.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="UrnId.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\AssertUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\CommandsUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\FuncUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\IdUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\PathUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\PerfUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Utils\ReflectionUtils.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\CompressedFileResult.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\CompressedResult.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\CompressionTypes.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\ContentType.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\EndPoint.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\EndpointType.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpError.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpHeaders.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpMethods.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpResponseFilter.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpResponseStreamWrapper.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpResult.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Web\HttpResultExtensions.cs" />
- <Compile Include="Web\MimeTypes.cs">
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="RequestContextExtensions.cs" />
- <Compile Include="Web\SerializationContext.cs">
- <SubType>Code</SubType>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\ServiceStack.Interfaces\ServiceStack.Interfaces.csproj">
- <Project>{42E1C8C0-A163-44CC-92B1-8F416F2C0B01}</Project>
- <Name>ServiceStack.Interfaces</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <None Include="README.md" />
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.30729</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{982416DB-C143-4028-A0C3-CF41892D18D3}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>ServiceStack.Common</RootNamespace>
+ <AssemblyName>ServiceStack.Common</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>3.5</OldToolsVersion>
+ <UpgradeBackupLocation />
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>False</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>True</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ <DocumentationFile>bin\Release\ServiceStack.Common.XML</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'STATIC_ONLY NO_EXPRESSIONS|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <OutputPath>bin\MonoTouch\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Optimize>False</Optimize>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'MonoTouch|AnyCPU' ">
+ <DebugSymbols>True</DebugSymbols>
+ <OutputPath>bin\MonoTouch\</OutputPath>
+ <DefineConstants>TRACE;DEBUG;MONOTOUCH</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Optimize>False</Optimize>
+ <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.ServiceModel" />
+ <Reference Include="System.ServiceModel.Web" />
+ <Reference Include="System.Web" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="ServiceStack.Text">
+ <HintPath>..\..\lib\ServiceStack.Text.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ActionExecExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="AssertExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ByteArrayExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DictionaryExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DirectoryInfoExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DisposableExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="EnumerableExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="EnumExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ExecExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Expressions\DelegateFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\ActionExecExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\AssertExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\ByteArrayExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\CollectionExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\DictionaryExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\EnumerableExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\IntExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\ITranslatorExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\ReflectionExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Extensions\StringExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="HostContext.cs" />
+ <Compile Include="IntExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="IPAddressExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\ClientFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\IMessageHandler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\IMessageHandlerDisposer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\IMessageHandlerFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\InMemoryMessageQueueClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\InMemoryTransientMessageFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\InMemoryTransientMessageService.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\MessageExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\MessageHandler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\MessageHandlerFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\MessageQueueClientFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\Rcon\Client.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\Rcon\Packet.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\Rcon\PacketCodec.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\Rcon\PacketProcessingClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\Rcon\Server.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Messaging\TransientMessageServiceBase.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Model.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ModelConfig.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Net30\ConcurrentDictionary.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Net30\ConcurrentQueue.cs" />
+ <Compile Include="Net30\ObjectPool.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Net30\SplitOrderedList.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Net30\Tuple.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="ReflectionExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Reflection\PropertyAccessor.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Reflection\StaticAccessors.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\AsyncServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\AuthDtos.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\DictionaryExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\GenericProxy.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\HttpMethod.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\IDuplex.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\IDuplexCallback.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\IOneWay.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\ISyncReply.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\IWcfServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\JsonRestClientAsync.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\JsonServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\JsvRestClientAsync.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\JsvServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\ServiceClientBase.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\Soap11ServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\Soap12ServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\UrlExtensions.cs" />
+ <Compile Include="ServiceClient.Web\WcfServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\WebRequestExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\WebRequestUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\WebServiceException.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\XLinqExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\XmlRestClientAsync.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceClient.Web\XmlServiceClient.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\DictionaryExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\DataContractDeserializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\DataContractSerializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\JsonDataContractDeserializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\JsonDataContractSerializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\KeyValueDataContractDeserializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\StringMapTypeDeserializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\XmlSerializableDeserializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Serialization\XmlSerializableSerializer.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Support\XmlSerializableWrapper.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Validation\ValidationError.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Validation\ValidationErrorField.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\Validation\ValidationErrorResult.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="ServiceModel\XLinqExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="StreamExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="StringExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\ActionExecHandler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\AdapterBase.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\AssignmentDefinition.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\CommandExecsHandler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\CommandResultsHandler.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\InMemoryLogFactory.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\LogicFacadeBase.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\NetDeflateProvider.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\NetGZipProvider.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Support\PropertyInvoker.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="TypeExtensions.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="UrnId.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\AssertUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\CommandsUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\FuncUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\IdUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\PathUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\PerfUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Utils\ReflectionUtils.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\CompressedFileResult.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\CompressedResult.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\CompressionTypes.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\ContentType.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\EndPoint.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\EndpointType.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpError.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpHeaders.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpMethods.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpResponseFilter.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpResponseStreamWrapper.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpResult.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Web\HttpResultExtensions.cs" />
+ <Compile Include="Web\MimeTypes.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="RequestContextExtensions.cs" />
+ <Compile Include="Web\SerializationContext.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\ServiceStack.Interfaces\ServiceStack.Interfaces.csproj">
+ <Project>{42E1C8C0-A163-44CC-92B1-8F416F2C0B01}</Project>
+ <Name>ServiceStack.Interfaces</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="README.md" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
</Project>
View
346 src/ServiceStack/WebHost.Endpoints/Support/Metadata/Controls/IndexOperationsControl.cs
@@ -1,174 +1,174 @@
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Web.UI;
-using ServiceStack.ServiceHost;
-using ServiceStack.WebHost.Endpoints.Support.Templates;
-
-namespace ServiceStack.WebHost.Endpoints.Support.Metadata.Controls
-{
- internal class IndexOperationsControl : System.Web.UI.Control
- {
- public IHttpRequest HttpRequest { get; set; }
- public string Title { get; set; }
- public List<string> OperationNames { get; set; }
- public string MetadataPageBodyHtml { get; set; }
- public IDictionary<int, string> Xsds { get; set; }
- public int XsdServiceTypesIndex { get; set; }
- public ServiceEndpointsMetadataConfig MetadataConfig { get; set; }
-
- protected override void Render(HtmlTextWriter output)
- {
- var parentPath = HttpRequest.GetParentAbsolutePath();
- var ignoreFormats = EndpointHost.Config.IgnoreFormatsInMetadata;
- var opTemplate = new StringBuilder("<li><span>{0}</span>");
- if (MetadataConfig.Xml != null && !ignoreFormats.Contains("xml"))
- opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">XML</a>", parentPath + MetadataConfig.Xml.DefaultMetadataUri);
- if (MetadataConfig.Json != null && !ignoreFormats.Contains("json"))
- opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSON</a>", parentPath + MetadataConfig.Json.DefaultMetadataUri);
- if (MetadataConfig.Jsv != null && !ignoreFormats.Contains("jsv"))
- opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSV</a>", parentPath + MetadataConfig.Jsv.DefaultMetadataUri);
-
- if (MetadataConfig.Custom != null)
- {
- foreach (var format in EndpointHost.ContentTypeFilter.ContentTypeFormats.Keys)
- {
- if (ignoreFormats.Contains(format)) continue;
-
- var uri = parentPath + string.Format(MetadataConfig.Custom.DefaultMetadataUri, format);
- opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">{1}</a>", uri, format.ToUpper());
- }
- }
-
- if (MetadataConfig.Soap11 != null && !ignoreFormats.Contains("soap11"))
- opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">SOAP 1.1</a>", parentPath + MetadataConfig.Soap11.DefaultMetadataUri);
- if (MetadataConfig.Soap12 != null && !ignoreFormats.Contains("soap12"))
- opTemplate.AppendFormat(@"<a class=""last"" href=""{0}?op={{0}}"">SOAP 1.2</a>", parentPath + MetadataConfig.Soap12.DefaultMetadataUri);
-
- opTemplate.Append("</li>");
-
- var operationsPart = new ListTemplate {
- Title = "Operations:",
- ListItems = this.OperationNames,
- ForEachListItem = operation => string.Format(opTemplate.ToString(), operation)
- }.ToString();
-
- var xsdsPart = new ListTemplate {
- Title = "XSDS:",
- ListItemsIntMap = this.Xsds,
- ListItemTemplate = @"<li><a href=""?xsd={0}"">{1}</a></li>"
- }.ToString();
-
- var wsdlTemplate = new StringBuilder();
- if (MetadataConfig.Soap11 != null || MetadataConfig.Soap12 != null)
- {
- wsdlTemplate.AppendLine("<h3>WSDLS:</h3>");
- wsdlTemplate.AppendLine("<ul>");
- if (MetadataConfig.Soap11 != null)
- {
- wsdlTemplate.AppendFormat(
- @"<li><a href=""{0}"">{0}</a></li>",
- MetadataConfig.Soap11.WsdlMetadataUri);
- }
- if (MetadataConfig.Soap12 != null)
- {
- wsdlTemplate.AppendFormat(
- @"<li><a href=""{0}"">{0}</a></li>",
- MetadataConfig.Soap12.WsdlMetadataUri);
- }
- wsdlTemplate.AppendLine("<ul>");
- }
-
- var renderedTemplate = string.Format(
- PageTemplate, this.Title, this.MetadataPageBodyHtml, this.XsdServiceTypesIndex,
- operationsPart, xsdsPart, wsdlTemplate);
-
- output.Write(renderedTemplate);
- }
-
- #region Page Template
- private const string PageTemplate = @"
-<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
-
-<html xmlns=""http://www.w3.org/1999/xhtml"" >
-<head>
- <title>{0}</title>
- <style type=""text/css"">
- BODY {{
- background-color:white;
- color:#000000;
- font-family:Verdana;
- margin: 0;
- }}
- H1 {{
- background-color: #036;
- color: #FFF;
- font-family: Tahoma;
- font-size: 26px;
- font-weight: normal;
- margin: 0;
- padding: 10px 0 3px 15px;
- }}
- FORM {{
- font-size: 0.7em;
- margin-left: 20px;
- padding-bottom: 2em;
- }}
- UL {{
- margin: 10px 0 0 10px;
- padding: 0px 0px 0px 10px;
- }}
- LI {{
- clear: left;
- margin-top: 10px;
- }}
- LI A {{
- color: #369;
- font-weight: bold;
- text-decoration: underline;
- }}
- LI A:hover {{
- color: #C30;
- }}
- .operations UL {{
- list-style: none;
- }}
- .operations SPAN {{
- float: left;
- display: block;
- width: 27em;
- }}
- .operations A {{
- border-right: 1px solid #CCC;
- margin-right: 1em;
- padding-right: 1em;
- }}
- .operations A.last {{
- border:none;
- }}
- </style>
-</head>
-<body>
- <h1>{0}</h1>
-
- <form id=""form1"">
- <p>The following operations are supported. For a formal definition, please review the Service <a href=""?xsd={2}"">XSD</a>.
- </p>
-
- <div class=""operations"">
- {3}
- </div>
-
- {1}
-
- {4}
-
- {5}
-
- </form>
-</body>
-</html>";
- #endregion
-
- }
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web.UI;
+using ServiceStack.ServiceHost;
+using ServiceStack.WebHost.Endpoints.Support.Templates;
+
+namespace ServiceStack.WebHost.Endpoints.Support.Metadata.Controls
+{
+ internal class IndexOperationsControl : System.Web.UI.Control
+ {
+ public IHttpRequest HttpRequest { get; set; }
+ public string Title { get; set; }
+ public List<string> OperationNames { get; set; }
+ public string MetadataPageBodyHtml { get; set; }
+ public IDictionary<int, string> Xsds { get; set; }
+ public int XsdServiceTypesIndex { get; set; }
+ public ServiceEndpointsMetadataConfig MetadataConfig { get; set; }
+
+ protected override void Render(HtmlTextWriter output)
+ {
+ var parentPath = HttpRequest.GetParentAbsolutePath();
+ var ignoreFormats = EndpointHost.Config.IgnoreFormatsInMetadata;
+ var opTemplate = new StringBuilder("<li><span>{0}</span>");
+ if (MetadataConfig.Xml != null && !ignoreFormats.Contains("xml"))
+ opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">XML</a>", parentPath + MetadataConfig.Xml.DefaultMetadataUri);
+ if (MetadataConfig.Json != null && !ignoreFormats.Contains("json"))
+ opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSON</a>", parentPath + MetadataConfig.Json.DefaultMetadataUri);
+ if (MetadataConfig.Jsv != null && !ignoreFormats.Contains("jsv"))
+ opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">JSV</a>", parentPath + MetadataConfig.Jsv.DefaultMetadataUri);
+
+ if (MetadataConfig.Custom != null)
+ {
+ foreach (var format in EndpointHost.ContentTypeFilter.ContentTypeFormats.Keys)
+ {
+ if (ignoreFormats.Contains(format)) continue;
+
+ var uri = parentPath + string.Format(MetadataConfig.Custom.DefaultMetadataUri, format);
+ opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">{1}</a>", uri, format.ToUpper());
+ }
+ }
+
+ if (MetadataConfig.Soap11 != null && !ignoreFormats.Contains("soap11"))
+ opTemplate.AppendFormat(@"<a href=""{0}?op={{0}}"">SOAP 1.1</a>", parentPath + MetadataConfig.Soap11.DefaultMetadataUri);
+ if (MetadataConfig.Soap12 != null && !ignoreFormats.Contains("soap12"))
+ opTemplate.AppendFormat(@"<a class=""last"" href=""{0}?op={{0}}"">SOAP 1.2</a>", parentPath + MetadataConfig.Soap12.DefaultMetadataUri);
+
+ opTemplate.Append("</li>");
+
+ var operationsPart = new ListTemplate {
+ Title = "Operations:",
+ ListItems = this.OperationNames,
+ ForEachListItem = operation => string.Format(opTemplate.ToString(), operation)
+ }.ToString();
+
+ var xsdsPart = new ListTemplate {
+ Title = "XSDS:",
+ ListItemsIntMap = this.Xsds,
+ ListItemTemplate = @"<li><a href=""?xsd={0}"">{1}</a></li>"
+ }.ToString();
+
+ var wsdlTemplate = new StringBuilder();
+ if (MetadataConfig.Soap11 != null || MetadataConfig.Soap12 != null)
+ {
+ wsdlTemplate.AppendLine("<h3>WSDLS:</h3>");
+ wsdlTemplate.AppendLine("<ul>");
+ if (MetadataConfig.Soap11 != null)
+ {
+ wsdlTemplate.AppendFormat(
+ @"<li><a href=""{0}"">{0}</a></li>",
+ MetadataConfig.Soap11.WsdlMetadataUri);
+ }
+ if (MetadataConfig.Soap12 != null)
+ {
+ wsdlTemplate.AppendFormat(
+ @"<li><a href=""{0}"">{0}</a></li>",
+ MetadataConfig.Soap12.WsdlMetadataUri);
+ }
+ wsdlTemplate.AppendLine("<ul>");
+ }
+
+ var renderedTemplate = string.Format(
+ PageTemplate, this.Title, this.MetadataPageBodyHtml, this.XsdServiceTypesIndex,
+ operationsPart, xsdsPart, wsdlTemplate);
+
+ output.Write(renderedTemplate);
+ }
+
+ #region Page Template
+ private const string PageTemplate = @"
+<!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
+
+<html xmlns=""http://www.w3.org/1999/xhtml"" >
+<head>
+ <title>{0}</title>
+ <style type=""text/css"">
+ BODY {{
+ background-color:white;
+ color:#000000;
+ font-family:Verdana;
+ margin: 0;
+ }}
+ H1 {{
+ background-color: #036;
+ color: #FFF;
+ font-family: Tahoma;
+ font-size: 26px;
+ font-weight: normal;
+ margin: 0;
+ padding: 10px 0 3px 15px;
+ }}
+ FORM {{
+ font-size: 0.7em;
+ margin-left: 20px;
+ padding-bottom: 2em;
+ }}
+ UL {{
+ margin: 10px 0 0 10px;
+ padding: 0px 0px 0px 10px;
+ }}
+ LI {{
+ clear: left;
+ margin-top: 10px;
+ }}
+ LI A {{
+ color: #369;
+ font-weight: bold;
+ text-decoration: underline;
+ }}
+ LI A:hover {{
+ color: #C30;
+ }}
+ .operations UL {{
+ list-style: none;
+ }}
+ .operations SPAN {{
+ float: left;
+ display: block;
+ width: 27em;
+ }}
+ .operations A {{
+ border-right: 1px solid #CCC;
+ margin-right: 1em;
+ padding-right: 1em;
+ }}
+ .operations A.last {{
+ border:none;
+ }}
+ </style>
+</head>
+<body>
+ <h1>{0}</h1>
+
+ <form id=""form1"">
+ <p>The following operations are supported. For a formal definition, please review the Service <a href=""?xsd={2}"">XSD</a>.
+ </p>
+
+ <div class=""operations"">
+ {3}
+ </div>
+
+ {1}
+
+ {4}
+
+ {5}
+
+ </form>
+</body>
+</html>";