Add stubs for some new .NET 4.0/4.5 WCF APIs.
authorMartin Baulig <martin.baulig@xamarin.com>
Tue, 12 Mar 2013 20:50:26 +0000 (16:50 -0400)
committerMartin Baulig <martin.baulig@xamarin.com>
Tue, 12 Mar 2013 21:23:01 +0000 (17:23 -0400)
12 files changed:
mcs/class/System.ServiceModel/System.ServiceModel.Channels/BindingParameterCollection.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpRequestMessageProperty.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpResponseMessageProperty.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpTransportBindingElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/HttpsTransportBindingElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ReliableSessionBindingElement.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportSettings.cs [new file with mode: 0644]
mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportUsage.cs [new file with mode: 0644]
mcs/class/System.ServiceModel/System.ServiceModel/NetHttpBinding.cs [new file with mode: 0644]
mcs/class/System.ServiceModel/System.ServiceModel/NetHttpMessageEncoding.cs [new file with mode: 0644]
mcs/class/System.ServiceModel/mobile_System.ServiceModel.dll.sources
mcs/class/System.ServiceModel/net_4_5_System.ServiceModel.dll.sources

index dbac38444bc8161232c104e1c9b542275bc73256..0787dd3b094f75a1715bbdab284bf6530f94cf71 100644 (file)
@@ -33,5 +33,21 @@ namespace System.ServiceModel.Channels
        public class BindingParameterCollection
                : KeyedByTypeCollection<object>
        {
+#if NET_4_5
+               protected override Type GetKeyForItem (object item)
+               {
+                       return base.GetKeyForItem (item);
+               }
+
+               protected override void InsertItem (int index, object item)
+               {
+                       base.InsertItem (index, item);
+               }
+
+               protected override void SetItem (int index, object item)
+               {
+                       base.SetItem (index, item);
+               }
+#endif
        }
 }
index 29f14c0d38acf109f235eb62be5a34d1d16cfc64..8ea39448f04e5928ea61c25fc2954b2666b91f2a 100644 (file)
@@ -31,6 +31,9 @@ using System.ServiceModel;
 namespace System.ServiceModel.Channels
 {
        public sealed class HttpRequestMessageProperty
+#if NET_4_5
+               : IMessageProperty
+#endif
        {
                public static string Name {
                        get { return "httpRequest"; }
@@ -62,5 +65,19 @@ namespace System.ServiceModel.Channels
                        get { return suppress_entity; }
                        set { suppress_entity = value; }
                }
+               
+               
+#if NET_4_5
+               IMessageProperty IMessageProperty.CreateCopy ()
+               {
+                       var copy = new HttpRequestMessageProperty ();
+                       // FIXME: Clone headers?
+                       copy.headers = headers;
+                       copy.method = method;
+                       copy.query_string = query_string;
+                       copy.suppress_entity = suppress_entity;
+                       return copy;
+               }
+#endif
        }
 }
index 11da8e1311900cfd20bf988bebd97a7f29c09e6b..e2cbf303b74cb015c89f49ba8c9bac7a51520587 100644 (file)
@@ -31,6 +31,9 @@ using System.ServiceModel;
 namespace System.ServiceModel.Channels
 {
        public sealed class HttpResponseMessageProperty
+#if NET_4_5
+               : IMessageProperty
+#endif
        {
                public static string Name {
                        get { return "httpResponse"; }
@@ -63,5 +66,18 @@ namespace System.ServiceModel.Channels
                        get { return suppress_entity; }
                        set { suppress_entity = value; }
                }
+               
+#if NET_4_5
+               IMessageProperty IMessageProperty.CreateCopy ()
+               {
+                       var copy = new HttpResponseMessageProperty ();
+                       // FIXME: Clone headers?
+                       copy.headers = headers;
+                       copy.status_desc = status_desc;
+                       copy.status_code = status_code;
+                       copy.suppress_entity = suppress_entity;
+                       return copy;
+               }
+#endif
        }
 }
index 0dbb5a48e1b16a3ff4d140ea937bab39f207f189..2c6b082867592bb770b231f7fcce7b9d7e603784 100644 (file)
@@ -251,16 +251,21 @@ namespace System.ServiceModel.Channels
                public override T GetProperty<T> (BindingContext context)
                {
                        // http://blogs.msdn.com/drnick/archive/2007/04/10/interfaces-for-getproperty-part-1.aspx
-#if !NET_2_1
                        if (typeof (T) == typeof (ISecurityCapabilities))
                                return (T) (object) new HttpBindingProperties (this);
                        if (typeof (T) == typeof (IBindingDeliveryCapabilities))
                                return (T) (object) new HttpBindingProperties (this);
-#endif
                        if (typeof (T) == typeof (TransferMode))
                                return (T) (object) TransferMode;
                        return base.GetProperty<T> (context);
                }
+               
+#if NET_4_5
+               public WebSocketTransportSettings WebSocketSettings {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+#endif
 
 #if !NET_2_1
                void IPolicyExportExtension.ExportPolicy (
@@ -347,7 +352,6 @@ namespace System.ServiceModel.Channels
 #endif
        }
 
-#if !NET_2_1
        class HttpBindingProperties : ISecurityCapabilities, IBindingDeliveryCapabilities
        {
                HttpTransportBindingElement source;
@@ -402,5 +406,4 @@ namespace System.ServiceModel.Channels
                        }
                }
        }
-#endif
 }
index 52f3a0e20cd515ca2b69f26e4689009b833a8104..f12978747418340d305b8c242e3300769e7e183e 100644 (file)
@@ -91,6 +91,7 @@ namespace System.ServiceModel.Channels
                        token.SetAttribute ("RequireClientCertificate", req_cli_cert ? "true" : "false");
                        return token;
                }
+#endif
 
                // overriden only in full profile
                public override T GetProperty<T> (BindingContext context)
@@ -99,10 +100,8 @@ namespace System.ServiceModel.Channels
                                return (T) (object) new HttpsBindingProperties (this);
                        return base.GetProperty<T> (context);
                }
-#endif
        }
 
-#if !NET_2_1
        class HttpsBindingProperties : HttpBindingProperties
        {
                HttpsTransportBindingElement source;
@@ -133,5 +132,4 @@ namespace System.ServiceModel.Channels
                        get { return source.RequireClientCertificate || base.SupportsClientWindowsIdentity; }
                }
        }
-#endif
 }
index 2a45cbdd547ea6e364b0e41fad781d7e89e205d1..440aa83288c3d69579d8df1b0ce2963f83b1afc1 100644 (file)
@@ -30,7 +30,10 @@ using System.ServiceModel.Description;
 
 namespace System.ServiceModel.Channels
 {
-       public sealed class ReliableSessionBindingElement : BindingElement, IPolicyExportExtension
+       public sealed class ReliableSessionBindingElement : BindingElement
+#if !MOBILE
+               , IPolicyExportExtension
+#endif
        {
                public ReliableSessionBindingElement ()
                {
@@ -65,7 +68,8 @@ namespace System.ServiceModel.Channels
                {
                        throw new NotImplementedException ();
                }
-
+               
+#if !NET_2_1
                [MonoTODO]
                public override IChannelListener<TChannel> BuildChannelListener<TChannel> (BindingContext context)
                {
@@ -73,13 +77,14 @@ namespace System.ServiceModel.Channels
                }
 
                [MonoTODO]
-               public override bool CanBuildChannelFactory<TChannel> (BindingContext context)
+               public override bool CanBuildChannelListener<TChannel> (BindingContext context)
                {
                        throw new NotImplementedException ();
                }
+#endif
 
                [MonoTODO]
-               public override bool CanBuildChannelListener<TChannel> (BindingContext context)
+               public override bool CanBuildChannelFactory<TChannel> (BindingContext context)
                {
                        throw new NotImplementedException ();
                }
@@ -93,10 +98,12 @@ namespace System.ServiceModel.Channels
                {
                        throw new NotImplementedException ();
                }
-
+               
+#if !MOBILE
                void IPolicyExportExtension.ExportPolicy (MetadataExporter exporter, PolicyConversionContext context)
                {
                        throw new NotImplementedException ();
                }
+#endif
        }
 }
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportSettings.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportSettings.cs
new file mode 100644 (file)
index 0000000..f6339fc
--- /dev/null
@@ -0,0 +1,67 @@
+// Authors:
+//      Martin Baulig (martin.baulig@xamarin.com)
+//
+// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+using System;
+
+namespace System.ServiceModel.Channels {
+       [MonoTODO]
+       public sealed class WebSocketTransportSettings : IEquatable<WebSocketTransportSettings> {
+               public WebSocketTransportSettings ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public const string BinaryEncoderTransferModeHeader = null;
+               public const string BinaryMessageReceivedAction = null;
+               public const string ConnectionOpenedAction = null;
+               public const string SoapContentTypeHeader = null;
+               public const string TextMessageReceivedAction = null;
+
+               public bool CreateNotificationOnConnection { get; set; }
+               public bool DisablePayloadMasking { get; set; }
+               public TimeSpan KeepAliveInterval { get; set; }
+               public int MaxPendingConnections { get; set; }
+               public int ReceiveBufferSize { get; set; }
+               public int SendBufferSize { get; set; }
+               public string SubProtocol { get; set; }
+               public WebSocketTransportUsage TransportUsage { get; set; }
+
+               public bool Equals (WebSocketTransportSettings other)
+               {
+                       return other.CreateNotificationOnConnection == CreateNotificationOnConnection &&
+                               other.DisablePayloadMasking == DisablePayloadMasking &&
+                               other.KeepAliveInterval == KeepAliveInterval &&
+                               other.MaxPendingConnections == MaxPendingConnections &&
+                               other.ReceiveBufferSize == ReceiveBufferSize &&
+                               other.SendBufferSize == SendBufferSize &&
+                               other.SubProtocol == SubProtocol &&
+                               other.TransportUsage == TransportUsage;
+               }
+               
+               
+       }
+}
+#endif
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportUsage.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Channels/WebSocketTransportUsage.cs
new file mode 100644 (file)
index 0000000..d919923
--- /dev/null
@@ -0,0 +1,34 @@
+// Authors:
+//      Martin Baulig (martin.baulig@xamarin.com)
+//
+// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_4_5
+namespace System.ServiceModel.Channels {
+       public enum WebSocketTransportUsage {
+               WhenDuplex,
+               Always,
+               Never
+       }
+}
+#endif
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/NetHttpBinding.cs b/mcs/class/System.ServiceModel/System.ServiceModel/NetHttpBinding.cs
new file mode 100644 (file)
index 0000000..342691f
--- /dev/null
@@ -0,0 +1,83 @@
+// Authors:
+//      Martin Baulig (martin.baulig@xamarin.com)
+//
+// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using System.ServiceModel.Channels;
+
+namespace System.ServiceModel {
+       [MonoTODO]
+       public class NetHttpBinding : HttpBindingBase {
+               public NetHttpBinding ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public NetHttpBinding (BasicHttpSecurityMode securityMode)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public NetHttpBinding (string configurationName)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public NetHttpBinding (
+                       BasicHttpSecurityMode securityMode, bool reliableSessionEnabled)
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public NetHttpMessageEncoding MessageEncoding { get; set; }
+               public OptionalReliableSession ReliableSession { get; set; }
+               public BasicHttpSecurity Security { get; set; }
+
+               public WebSocketTransportSettings WebSocketSettings {
+                       get { throw new NotImplementedException (); }
+               }
+               
+               public override string Scheme {
+                       get { throw new NotImplementedException (); }
+               }
+               
+               public override BindingElementCollection CreateBindingElements ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public bool ShouldSerializeReliableSession ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               public bool ShouldSerializeSecurity ()
+               {
+                       throw new NotImplementedException ();
+               }
+               
+               
+               
+       }
+}
\ No newline at end of file
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/NetHttpMessageEncoding.cs b/mcs/class/System.ServiceModel/System.ServiceModel/NetHttpMessageEncoding.cs
new file mode 100644 (file)
index 0000000..3f22ffd
--- /dev/null
@@ -0,0 +1,32 @@
+// Authors:
+//      Martin Baulig (martin.baulig@xamarin.com)
+//
+// Copyright 2012 Xamarin Inc. (http://www.xamarin.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+namespace System.ServiceModel {
+       public enum NetHttpMessageEncoding {
+               Binary,
+               Text,
+               Mtom
+       }
+}
index 2714dd747c09f4ba85e6dc159e039892ed63d1bd..f0de435d755381d056c6342af5bc4043b65864af 100644 (file)
@@ -83,6 +83,7 @@ System.ServiceModel.Channels/HttpRequestMessageProperty.cs
 System.ServiceModel.Channels/HttpResponseMessageProperty.cs
 System.ServiceModel.Channels/HttpTransportBindingElement.cs
 System.ServiceModel.Channels/HttpsTransportBindingElement.cs
+System.ServiceModel.Channels/IBindingDeliveryCapabilities.cs
 System.ServiceModel.Channels/IBindingRuntimePreferences.cs
 System.ServiceModel.Channels/IChannel.cs
 System.ServiceModel.Channels/IChannelFactory.cs
@@ -121,6 +122,7 @@ System.ServiceModel.Channels/MessageImpl.cs
 System.ServiceModel.Channels/MessageProperties.cs
 System.ServiceModel.Channels/MessageVersion.cs
 System.ServiceModel.Channels/OutputChannelBase.cs
+System.ServiceModel.Channels/ReliableSessionBindingElement.cs
 System.ServiceModel.Channels/RequestChannelBase.cs
 System.ServiceModel.Channels/RequestContext.cs
 System.ServiceModel.Channels/SecurityBindingElement.cs
@@ -130,6 +132,8 @@ System.ServiceModel.Channels/TextMessageEncodingBindingElement.cs
 System.ServiceModel.Channels/TransportBindingElement.cs
 System.ServiceModel.Channels/TransportSecurityBindingElement.cs
 System.ServiceModel.Channels/UnderstoodHeaders.cs
+System.ServiceModel.Channels/WebSocketTransportSettings.cs
+System.ServiceModel.Channels/WebSocketTransportUsage.cs
 System.ServiceModel.Channels/XmlObjectSerializerBodyWriter.cs
 System.ServiceModel.Channels/XmlReaderBodyWriter.cs
 System.ServiceModel.Description/ClientCredentials.cs
@@ -180,6 +184,8 @@ System.ServiceModel/HttpBindingBase.cs
 System.ServiceModel/BasicHttpBinding_4_5.cs
 System.ServiceModel/BasicHttpSecurity.cs
 System.ServiceModel/BasicHttpMessageSecurity.cs
+System.ServiceModel/BasicHttpsBinding.cs
+System.ServiceModel/BasicHttpsSecurity.cs
 System.ServiceModel/ChannelFactory.cs
 System.ServiceModel/ChannelFactory_1.cs
 System.ServiceModel/ClientBase.cs
@@ -225,11 +231,16 @@ System.ServiceModel/MessageHeaderException.cs
 System.ServiceModel/MessageHeader_1.cs
 System.ServiceModel/MessageParameterAttribute.cs
 System.ServiceModel/MessagePropertyAttribute.cs
+System.ServiceModel/NetHttpBinding.cs
+System.ServiceModel/NetHttpMessageEncoding.cs
 System.ServiceModel/OperationContext.cs
 System.ServiceModel/OperationContextScope.cs
 System.ServiceModel/OperationContractAttribute.cs
+System.ServiceModel/OptionalReliableSession.cs
 System.ServiceModel/ProtocolException.cs
 System.ServiceModel/QuotaExceededException.cs
+System.ServiceModel/ReliableMessagingVersion.cs
+System.ServiceModel/ReliableSession.cs
 System.ServiceModel/ServerTooBusyException.cs
 System.ServiceModel/ServiceActivationException.cs
 System.ServiceModel/ServiceContractAttribute.cs
index 700c289f4746f80491c3b01215fca8b0787b930e..0be4c6b793ec07546ecb3715d167417e6923a124 100644 (file)
@@ -3,6 +3,10 @@ System.ServiceModel/HttpBindingBase.cs
 System.ServiceModel/BasicHttpBinding_4_5.cs
 System.ServiceModel/BasicHttpsBinding.cs
 System.ServiceModel/BasicHttpsSecurity.cs
+System.ServiceModel/NetHttpBinding.cs
+System.ServiceModel/NetHttpMessageEncoding.cs
+System.ServiceModel.Channels/WebSocketTransportSettings.cs
+System.ServiceModel.Channels/WebSocketTransportUsage.cs
 System.ServiceModel.Configuration/BasicHttpBindingElement_4_5.cs
 System.ServiceModel.Configuration/HttpBindingBaseElement.cs
 System.ServiceModel.Configuration/BasicHttpsBindingElement.cs