SoapServerFormatterSinkProvider.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // System.Runtime.Remoting.Channels.SoapServerFormatterSinkProvider.cs
  3. //
  4. // Author: Rodrigo Moya ([email protected])
  5. // Lluis Sanchez Gual ([email protected])
  6. //
  7. // 2002 (C) Copyright, Ximian, Inc.
  8. //
  9. using System.Collections;
  10. using System.Runtime.Serialization.Formatters;
  11. using System.Runtime.InteropServices;
  12. namespace System.Runtime.Remoting.Channels
  13. {
  14. public class SoapServerFormatterSinkProvider :
  15. IServerFormatterSinkProvider, IServerChannelSinkProvider
  16. {
  17. private IServerChannelSinkProvider _next;
  18. SoapCore _soapCore;
  19. #if NET_1_0
  20. internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding" };
  21. #else
  22. internal static string[] AllowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" };
  23. #endif
  24. public SoapServerFormatterSinkProvider ()
  25. {
  26. _soapCore = SoapCore.DefaultInstance;
  27. }
  28. public SoapServerFormatterSinkProvider (IDictionary properties,
  29. ICollection providerData)
  30. {
  31. _soapCore = new SoapCore (this, properties, AllowedProperties);
  32. }
  33. public IServerChannelSinkProvider Next
  34. {
  35. get { return _next; }
  36. set { _next = value; }
  37. }
  38. #if NET_1_1
  39. [ComVisible(false)]
  40. public TypeFilterLevel TypeFilterLevel
  41. {
  42. get { return _soapCore.TypeFilterLevel; }
  43. set
  44. {
  45. IDictionary props = (IDictionary) ((ICloneable)_soapCore.Properties).Clone ();
  46. props ["typeFilterLevel"] = value;
  47. _soapCore = new SoapCore (this, props, AllowedProperties);
  48. }
  49. }
  50. #endif
  51. public IServerChannelSink CreateSink (IChannelReceiver channel)
  52. {
  53. IServerChannelSink chain = _next.CreateSink(channel);
  54. SoapServerFormatterSink sinkFormatter = new SoapServerFormatterSink(SoapServerFormatterSink.Protocol.Http, chain, channel);
  55. sinkFormatter.SoapCore = _soapCore;
  56. return sinkFormatter;
  57. }
  58. public void GetChannelData (IChannelDataStore channelData)
  59. {
  60. if(_next != null)
  61. _next.GetChannelData(channelData);
  62. }
  63. }
  64. }