From: Atsushi Eno Date: Thu, 15 Oct 2009 07:49:55 +0000 (-0000) Subject: 2009-10-15 Atsushi Enomoto X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=f401808dfcfe1834fd9bc0a1b6c2d51e6fe35d69;p=mono.git 2009-10-15 Atsushi Enomoto * ServiceHostBase.cs : fix relative URI construction for ServiceMetadataExtension. It should create URI like http://localhost/test.svc/wsdl, not http://localhost/wsdl . svn path=/trunk/mcs/; revision=144184 --- diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog b/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog index 731ea42f750..2091592007e 100755 --- a/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog +++ b/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog @@ -1,3 +1,9 @@ +2009-10-15 Atsushi Enomoto + + * ServiceHostBase.cs : fix relative URI construction for + ServiceMetadataExtension. It should create URI like + http://localhost/test.svc/wsdl, not http://localhost/wsdl . + 2009-10-15 Atsushi Enomoto * ServiceHostBase.cs : on opening the host, check service endpoints diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs b/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs index b58174b9aaf..26bec839d5a 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel/ServiceHostBase.cs @@ -85,7 +85,8 @@ namespace System.ServiceModel } } - internal Uri CreateUri (string scheme, Uri relativeUri) { + internal Uri CreateUri (string scheme, Uri relativeUri) + { Uri baseUri = base_addresses.Contains (scheme) ? base_addresses [scheme] : null; if (relativeUri == null) @@ -95,7 +96,13 @@ namespace System.ServiceModel if (baseUri == null) return null; var s = relativeUri.ToString (); - return new Uri (baseUri, s.Length > 0 && s [0] == '/' ? '.' + s : s); + if (s.Length == 0) + return baseUri; + var l = baseUri.LocalPath; + if (l.Length > 0 && l [l.Length - 1] != '/') + return new Uri (String.Concat (baseUri.ToString (), "/", relativeUri.ToString ())); + else + return new Uri (baseUri, relativeUri); } public ChannelDispatcherCollection ChannelDispatchers {