+2010-06-23 Atsushi Enomoto <atsushi@ximian.com>
+
+ * HttpListenerManager.cs :
+ No need to get messed around MetadataPublishingInfo anymore.
+
2010-06-23 Atsushi Enomoto <atsushi@ximian.com>
* HttpListenerManager.cs : remove extra different code paths for
{
static Dictionary<Uri, List<IChannelListener>> registered_channels;
IChannelListener channel_listener;
- MetadataPublishingInfo mex_info;
- HttpGetWsdl wsdl_instance;
ManualResetEvent wait_http_ctx = new ManualResetEvent (false);
List<HttpContextInfo> pending = new List<HttpContextInfo> ();
- public MetadataPublishingInfo MexInfo { get { return mex_info; } }
public HttpTransportBindingElement Source { get; private set; }
public ChannelDispatcher Dispatcher { get; private set; }
{
this.Dispatcher = dispatcher;
this.channel_listener = channelListener;
- mex_info = Dispatcher != null ? Dispatcher.Listener.GetProperty<MetadataPublishingInfo> () : null;
- wsdl_instance = mex_info != null ? mex_info.Instance : null;
Source = source;
if (securityTokenManager != null) {
registered_channels [channel_listener.Uri] = new List<IChannelListener> ();
OnRegister (channel_listener, timeout);
registered_channels [channel_listener.Uri].Add (channel_listener);
-
- // make sure to fill wsdl_instance among other
- // listeners. It is somewhat hacky way, but
- // otherwise there is no assured way to do it.
- var wsdl = wsdl_instance;
- if (wsdl == null)
- foreach (var l in registered_channels [channel_listener.Uri])
- if ((wsdl = l.GetProperty<HttpListenerManager> ().wsdl_instance) != null)
- break;
- if (wsdl != null) {
- foreach (var l in registered_channels [channel_listener.Uri])
- l.GetProperty<HttpListenerManager> ().wsdl_instance = wsdl;
- }
}
public void Stop (bool abort)
+2010-06-23 Atsushi Enomoto <atsushi@ximian.com>
+
+ * ServiceMetadataExtension.cs : Reduced not a few lines of code,
+ now that we know wsdl and help do not have to be differentiated,
+ this extension support can be a lot simpler.
+
2010-06-23 Atsushi Enomoto <atsushi@ximian.com>
* ServiceMetadataExtension.cs : add Instance field for simplification.
if (dispatchers == null)
dispatchers = new Dictionary<Uri, ChannelDispatcher> ();
- else if (dispatchers.ContainsKey (uri)) {
- var info = dispatchers [uri].Listener.GetProperty<MetadataPublishingInfo> ();
- if (isMex)
- info.SupportsMex = true;
- else
- info.SupportsHelp = true;
- return;
- }
+ else if (dispatchers.ContainsKey (uri))
+ return; // already exists (e.g. reached here for wsdl while help is already filled on the same URI.)
if (binding == null) {
switch (scheme) {
var channelDispatcher = new DispatcherBuilder (Owner).BuildChannelDispatcher (owner.Description.ServiceType, se, new BindingParameterCollection ());
channelDispatcher.MessageVersion = MessageVersion.None; // it has no MessageVersion.
- // add HttpGetWsdl to indicate that the ChannelDispatcher is for mex or help.
- var listener = channelDispatcher.Listener as ChannelListenerBase;
- if (listener != null)
- listener.Properties.Add (new MetadataPublishingInfo () { SupportsMex = isMex, SupportsHelp = !isMex, Instance = instance });
- else
- throw new InvalidOperationException ("FIXME: attempt to use ServiceMetadataExtension to not-supported channel listener: " + listener.GetType ());
channelDispatcher.IsMex = true;
channelDispatcher.Endpoints [0].DispatchRuntime.InstanceContextProvider = new SingletonInstanceContextProvider (new InstanceContext (owner, instance));
SMMessage Get (SMMessage req);
}
- // It is used to identify which page to serve when a channel dispatcher
- // has a listener to an relatively empty URI (conflicting with the
- // target service endpoint)
- //
- // Can't be enum as it is for GetProperty<T> ().
- internal class MetadataPublishingInfo
- {
- public bool SupportsMex { get; set; }
- public bool SupportsHelp { get; set; }
- public HttpGetWsdl Instance { get; set; }
- }
-
class HttpGetWsdl : IHttpGetHelpPageAndMetadataContract
{
ServiceMetadataExtension ext;