Merge pull request #4453 from lambdageek/bug-49721
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels / Binding.cs
index dab08fbd28239d84607496240bd64c17d47ac601..5d942eebb25d119f29d778db8f46a4f3e0c0c139 100644 (file)
@@ -85,14 +85,7 @@ namespace System.ServiceModel.Channels
                public abstract string Scheme { get; }
 
                public MessageVersion MessageVersion {
-                       get {
-                               foreach (BindingElement e in CreateBindingElements ()) {
-                                       MessageEncodingBindingElement me = e as MessageEncodingBindingElement;
-                                       if (me != null)
-                                               return me.MessageVersion;
-                               }
-                               return null;
-                       }
+                       get { return GetProperty<MessageVersion> (new BindingParameterCollection ()); }
                }
 
                BindingContext CreateContext (
@@ -140,6 +133,7 @@ namespace System.ServiceModel.Channels
                        return CreateContext (parameters).BuildInnerChannelFactory<TChannel> ();
                }
 
+#if !MOBILE
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
                        Uri listenUriBaseAddress,
@@ -182,7 +176,7 @@ namespace System.ServiceModel.Channels
 
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
-                       Uri listenUri,
+                       Uri listenUriBaseAddress,
                        params object [] parameters)
                        where TChannel : class, IChannel
                {
@@ -190,16 +184,16 @@ namespace System.ServiceModel.Channels
                                new BindingParameterCollection ();
                        foreach (object o in parameters)
                                pl.Add (o);
-                       return BuildChannelListener<TChannel> (listenUri, pl);
+                       return BuildChannelListener<TChannel> (listenUriBaseAddress, pl);
                }
 
                public virtual IChannelListener<TChannel>
                        BuildChannelListener<TChannel> (
-                       Uri listenUri,
+                       Uri listenUriBaseAddress,
                        BindingParameterCollection parameters)
                        where TChannel : class, IChannel
                {
-                       return BuildChannelListener<TChannel> (listenUri,
+                       return BuildChannelListener<TChannel> (listenUriBaseAddress,
                                String.Empty, parameters);
                }
 
@@ -253,6 +247,7 @@ namespace System.ServiceModel.Channels
                                throw new ArgumentNullException ("parameters");
                        return CreateContext (parameters).BuildInnerChannelListener<TChannel> ();
                }
+#endif
 
                public bool CanBuildChannelFactory<TChannel> (
                        params object [] parameters)
@@ -272,6 +267,7 @@ namespace System.ServiceModel.Channels
                        return CreateContext (parameters).CanBuildInnerChannelFactory<TChannel> ();
                }
 
+#if !MOBILE
                public bool CanBuildChannelListener<TChannel> (
                        params object [] parameters)
                        where TChannel : class, IChannel
@@ -291,6 +287,7 @@ namespace System.ServiceModel.Channels
                                throw new ArgumentNullException ("parameters");
                        return CreateContext (parameters).CanBuildInnerChannelListener<TChannel> ();
                }
+#endif
 
                public abstract BindingElementCollection CreateBindingElements ();