+2009-10-15 Atsushi Enomoto <atsushi@ximian.com>
+
+ * 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 <atsushi@ximian.com>
* ServiceHostBase.cs : on opening the host, check service endpoints
}
}
- 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)
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 {