SoapServerFormatterSinkProvider.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. namespace System.Runtime.Remoting.Channels
  11. {
  12. public class SoapServerFormatterSinkProvider :
  13. IServerFormatterSinkProvider, IServerChannelSinkProvider
  14. {
  15. private IServerChannelSinkProvider _next;
  16. SoapCore _soapCore;
  17. #if NET_1_0
  18. static string[] allowedProperties = new string [] { "includeVersions", "strictBinding" };
  19. #endif
  20. #if NET_1_1
  21. static string[] allowedProperties = new string [] { "includeVersions", "strictBinding", "typeFilterLevel" };
  22. #endif
  23. public SoapServerFormatterSinkProvider ()
  24. {
  25. _soapCore = SoapCore.DefaultInstance;
  26. }
  27. public SoapServerFormatterSinkProvider (IDictionary properties,
  28. ICollection providerData)
  29. {
  30. _soapCore = new SoapCore (this, properties, allowedProperties);
  31. }
  32. public IServerChannelSinkProvider Next
  33. {
  34. get { return _next; }
  35. set { _next = value; }
  36. }
  37. public IServerChannelSink CreateSink (IChannelReceiver channel)
  38. {
  39. IServerChannelSink chain = _next.CreateSink(channel);
  40. SoapServerFormatterSink sinkFormatter = new SoapServerFormatterSink(SoapServerFormatterSink.Protocol.Http, chain, channel);
  41. sinkFormatter.SoapCore = _soapCore;
  42. return sinkFormatter;
  43. }
  44. public void GetChannelData (IChannelDataStore channelData)
  45. {
  46. if(_next != null)
  47. _next.GetChannelData(channelData);
  48. }
  49. }
  50. }