//\r
// 2002 (C) Copyright, Ximian, Inc.\r
//\r
-
-//
-// 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.
-//
+\r
+//\r
+// Permission is hereby granted, free of charge, to any person obtaining\r
+// a copy of this software and associated documentation files (the\r
+// "Software"), to deal in the Software without restriction, including\r
+// without limitation the rights to use, copy, modify, merge, publish,\r
+// distribute, sublicense, and/or sell copies of the Software, and to\r
+// permit persons to whom the Software is furnished to do so, subject to\r
+// the following conditions:\r
+// \r
+// The above copyright notice and this permission notice shall be\r
+// included in all copies or substantial portions of the Software.\r
+// \r
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\r
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\r
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\r
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\r
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\r
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+//\r
\r
using System.Collections;\r
using System.IO;\r
}\r
}\r
\r
-#if NET_1_1\r
[ComVisible(false)]\r
public TypeFilterLevel TypeFilterLevel\r
{\r
_soapCore = new SoapCore (this, props, SoapServerFormatterSinkProvider.AllowedProperties);\r
}\r
}\r
-#endif\r
\r
public void AsyncProcessResponse (IServerResponseChannelSinkStack sinkStack, object state,\r
IMessage msg, ITransportHeaders headers, Stream stream)\r
IMessage requestMsg, ITransportHeaders requestHeaders, Stream requestStream,\r
out IMessage responseMsg, out ITransportHeaders responseHeaders, out Stream responseStream)\r
{\r
+ // Check whether the request was already processed by another\r
+ // formatter sink and pass the request to the next sink if so.\r
+ if (requestMsg != null)\r
+ return next_sink.ProcessMessage (sinkStack,\r
+ requestMsg,\r
+ requestHeaders,\r
+ requestStream,\r
+ out responseMsg,\r
+ out responseHeaders,\r
+ out responseStream);\r
+\r
+ // Check whether the request is suitable for this formatter\r
+ // and pass the request to the next sink if not.\r
+ // Note that a null content-type is handled as suitable,\r
+ // otherwise no other sink will be able to handle the request.\r
+ string contentType = requestHeaders["Content-Type"] as string;\r
+ if (contentType == null || !contentType.StartsWith ("text/xml") || requestHeaders["SOAPAction"] == null) {\r
+ return next_sink.ProcessMessage (sinkStack,\r
+ requestMsg,\r
+ requestHeaders,\r
+ requestStream,\r
+ out responseMsg,\r
+ out responseHeaders,\r
+ out responseStream);\r
+ }\r
+\r
responseMsg = null;\r
responseHeaders = null;\r
responseStream = null;\r
SoapFormatter fm = _soapCore.GetSafeDeserializer ();\r
SoapMessage soapMessage = soapMsgFormatter.CreateSoapMessage (true);\r
fm.TopObject = soapMessage;\r
- requestStream.Position = 0;\r
fm.Deserialize(requestStream);\r
\r
requestMsg = soapMsgFormatter.BuildMethodCallFromSoapMessage(soapMessage, uri);\r
object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders);\r
responseStream = new MemoryStream();\r
_soapCore.Serializer.Serialize(responseStream, rtnMessageObject);\r
+ responseStream.Position = 0;\r
}\r
}\r
}\r
object rtnMessageObject = soapMsgFormatter.BuildSoapMessageFromMethodResponse((IMethodReturnMessage) responseMsg, out responseHeaders);\r
responseStream = new MemoryStream();\r
_soapCore.Serializer.Serialize(responseStream, rtnMessageObject);\r
+ responseStream.Position = 0;\r
sp = ServerProcessing.Complete;\r
}\r
\r