X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Runtime.Remoting%2FSystem.Runtime.Remoting.Channels%2FSoapServerFormatterSink.cs;h=d818bca48c7d190ac2309ed9459ba150728e93dc;hb=c0a8ef12af1f473bfc837325581fe738f1b3178c;hp=ec26fda61cc2254a40439a9780778a6ea86ef256;hpb=53e266903ec6b2d822cf5b0c566f6374df5307a4;p=mono.git diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs index ec26fda61cc..d818bca48c7 100644 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs +++ b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting.Channels/SoapServerFormatterSink.cs @@ -86,7 +86,6 @@ namespace System.Runtime.Remoting.Channels { } } -#if NET_1_1 [ComVisible(false)] public TypeFilterLevel TypeFilterLevel { @@ -98,7 +97,6 @@ namespace System.Runtime.Remoting.Channels { _soapCore = new SoapCore (this, props, SoapServerFormatterSinkProvider.AllowedProperties); } } -#endif public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state, IMessage msg, ITransportHeaders headers, Stream stream) @@ -146,18 +144,14 @@ namespace System.Runtime.Remoting.Channels { // Note that a null content-type is handled as suitable, // otherwise no other sink will be able to handle the request. string contentType = requestHeaders["Content-Type"] as string; - if (contentType != null && !contentType.StartsWith ("text/xml")) { - try { - return next_sink.ProcessMessage (sinkStack, - requestMsg, - requestHeaders, - requestStream, - out responseMsg, - out responseHeaders, - out responseStream); - } catch { - // Let this formatter handle the exception. - } + if (contentType == null || !contentType.StartsWith ("text/xml") || requestHeaders["SOAPAction"] == null) { + return next_sink.ProcessMessage (sinkStack, + requestMsg, + requestHeaders, + requestStream, + out responseMsg, + out responseHeaders, + out responseStream); } responseMsg = null; @@ -179,7 +173,6 @@ namespace System.Runtime.Remoting.Channels { SoapFormatter fm = _soapCore.GetSafeDeserializer (); SoapMessage soapMessage = soapMsgFormatter.CreateSoapMessage (true); fm.TopObject = soapMessage; - requestStream.Position = 0; fm.Deserialize(requestStream); requestMsg = soapMsgFormatter.BuildMethodCallFromSoapMessage(soapMessage, uri); @@ -192,6 +185,7 @@ namespace System.Runtime.Remoting.Channels { object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders); responseStream = new MemoryStream(); _soapCore.Serializer.Serialize(responseStream, rtnMessageObject); + responseStream.Position = 0; } } } @@ -201,6 +195,7 @@ namespace System.Runtime.Remoting.Channels { object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders); responseStream = new MemoryStream(); _soapCore.Serializer.Serialize(responseStream, rtnMessageObject); + responseStream.Position = 0; sp = ServerProcessing.Complete; }