2009-04-28 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 28 Apr 2009 18:50:16 +0000 (18:50 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 28 Apr 2009 18:50:16 +0000 (18:50 -0000)
* BinaryMessageEncoder.cs : implement part of in-band dictionary
  support for [MC-NBFSE] record in [MC-NMF], in this class.

svn path=/trunk/mcs/; revision=132881

mcs/class/System.ServiceModel/System.ServiceModel.Channels/BinaryMessageEncoder.cs
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog

index 9a1d16a2c7af14e8c6b182663d58c1b9a71614e2..574d820a6b5f5daf5db55a28ce8902fba7e7d441 100644 (file)
@@ -215,6 +215,14 @@ namespace System.ServiceModel.Channels
                public override Message ReadMessage (ArraySegment<byte> buffer,
                        BufferManager bufferManager, string contentType)
                {
+                       if (contentType != ContentType)
+                               throw new ProtocolException ("Only content type 'application/soap+msbin1' is allowed.");
+
+                       // FIXME: retrieve reader session and message body.
+
+                       throw new NotImplementedException ();
+
+/*
                        // FIXME: use bufferManager
                        return Message.CreateMessage (
                                XmlDictionaryReader.CreateBinaryReader (
@@ -222,13 +230,20 @@ namespace System.ServiceModel.Channels
                                        soap_dictionary,
                                        owner != null ? owner.Owner.ReaderQuotas : new XmlDictionaryReaderQuotas ()),
                                int.MaxValue, MessageVersion);
+*/
                }
 
+               // It is sort of nasty hack, but there is no other way to provide reader session from TCP stream.
+               internal XmlBinaryReaderSession CurrentBinarySession { get; set; }
+
                public override Message ReadMessage (Stream stream,
                        int maxSizeOfHeaders, string contentType)
                {
+                       if (contentType != ContentType)
+                               throw new ProtocolException ("Only content type 'application/soap+msbin1' is allowed.");
+
                        return Message.CreateMessage (
-                               XmlDictionaryReader.CreateBinaryReader (stream, soap_dictionary, owner != null ? owner.Owner.ReaderQuotas : new XmlDictionaryReaderQuotas ()),
+                               XmlDictionaryReader.CreateBinaryReader (stream, soap_dictionary, owner != null ? owner.Owner.ReaderQuotas : new XmlDictionaryReaderQuotas (), CurrentBinarySession),
                                maxSizeOfHeaders, MessageVersion);
                }
 
index 74b33e88d532c2e8ea7c11aa74aebff8401a2fdb..681b3681c5eadf10f1787433e4ae467c3c7ef5a6 100755 (executable)
@@ -1,3 +1,8 @@
+2009-04-28  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * BinaryMessageEncoder.cs : implement part of in-band dictionary
+         support for [MC-NBFSE] record in [MC-NMF], in this class.
+
 2009-04-28  Atsushi Enomoto  <atsushi@ximian.com>
 
        * BinaryMessageEncodingBindingElement.cs : clear extra public members.