Browse Source

2010-07-14 Atsushi Enomoto <[email protected]>

	* BinaryMessageEncoder.cs, MessageEncoder.cs:
	  The default content type value is null, not the ContentType value.

	* HttpReplyChannel.cs : pass HTTP ContentType header value to
	  MessageEncoder.ReadMessage().


svn path=/trunk/mcs/; revision=160376
Atsushi Eno 15 years ago
parent
commit
64372ac47a

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/ChangeLog

@@ -1,3 +1,8 @@
+2010-07-14  Atsushi Enomoto  <[email protected]>
+
+	* HttpReplyChannel.cs : pass HTTP ContentType header value to
+	  MessageEncoder.ReadMessage().
+
 2010-07-08  Atsushi Enomoto  <[email protected]>
 
 	* HttpRequestContext.cs : remove extra Action handling and old comment.

+ 1 - 1
mcs/class/System.ServiceModel/System.ServiceModel.Channels.Http/HttpReplyChannel.cs

@@ -178,7 +178,7 @@ namespace System.ServiceModel.Channels.Http
 			int maxSizeOfHeaders = 0x10000;
 
 			var msg = Encoder.ReadMessage (
-				ctxi.Request.InputStream, maxSizeOfHeaders);
+				ctxi.Request.InputStream, maxSizeOfHeaders, ctxi.Request.ContentType);
 
 			if (MessageVersion.Envelope.Equals (EnvelopeVersion.Soap11) ||
 			    MessageVersion.Addressing.Equals (AddressingVersion.None)) {

+ 2 - 2
mcs/class/System.ServiceModel/System.ServiceModel.Channels/BinaryMessageEncoder.cs

@@ -64,7 +64,7 @@ namespace System.ServiceModel.Channels
 		public override Message ReadMessage (ArraySegment<byte> buffer,
 			BufferManager bufferManager, string contentType)
 		{
-			if (contentType != ContentType)
+			if (contentType != null && contentType != ContentType)
 				throw new ProtocolException ("Only content type 'application/soap+msbin1' is allowed.");
 
 			// FIXME: retrieve reader session and message body.
@@ -89,7 +89,7 @@ namespace System.ServiceModel.Channels
 		public override Message ReadMessage (Stream stream,
 			int maxSizeOfHeaders, string contentType)
 		{
-			if (contentType != ContentType)
+			if (contentType != null && contentType != ContentType)
 				throw new ProtocolException ("Only content type 'application/soap+msbin1' is allowed.");
 
 			// FIXME: remove this extraneous buffering. It is somehow required for HTTP + binary encoding binding. The culprit is probably in binary xml reader or writer, but not sure.

+ 5 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Channels/ChangeLog

@@ -1,3 +1,8 @@
+2010-07-14  Atsushi Enomoto  <[email protected]>
+
+	* BinaryMessageEncoder.cs, MessageEncoder.cs:
+	  The default content type value is null, not the ContentType value.
+
 2010-07-12  Atsushi Enomoto  <[email protected]>
 
 	* MessageSecurityBindingSupport.cs : and move this too.

+ 2 - 2
mcs/class/System.ServiceModel/System.ServiceModel.Channels/MessageEncoder.cs

@@ -57,7 +57,7 @@ namespace System.ServiceModel.Channels
 		public Message ReadMessage (ArraySegment<byte> buffer,
 			BufferManager bufferManager)
 		{
-			return ReadMessage (buffer, bufferManager, ContentType);
+			return ReadMessage (buffer, bufferManager, null);
 		}
 
 		public abstract Message ReadMessage (ArraySegment<byte> buffer,
@@ -65,7 +65,7 @@ namespace System.ServiceModel.Channels
 
 		public Message ReadMessage (Stream stream, int maxSizeOfHeaders)
 		{
-			return ReadMessage (stream, maxSizeOfHeaders, ContentType);
+			return ReadMessage (stream, maxSizeOfHeaders, null);
 		}
 
 		public abstract Message ReadMessage (Stream stream,