BinaryMessageEncodingBindingElement.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. //
  2. // BinaryMessageEncodingBindingElement.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005 Novell, Inc. http://www.novell.com
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining
  10. // a copy of this software and associated documentation files (the
  11. // "Software"), to deal in the Software without restriction, including
  12. // without limitation the rights to use, copy, modify, merge, publish,
  13. // distribute, sublicense, and/or sell copies of the Software, and to
  14. // permit persons to whom the Software is furnished to do so, subject to
  15. // the following conditions:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  20. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  21. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  22. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  24. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  25. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  26. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  27. //
  28. using System;
  29. using System.ServiceModel.Channels;
  30. using System.ServiceModel.Description;
  31. using System.Text;
  32. using System.Xml;
  33. namespace System.ServiceModel.Channels
  34. {
  35. [MonoTODO]
  36. public sealed class BinaryMessageEncodingBindingElement
  37. : MessageEncodingBindingElement,
  38. IWsdlExportExtension, IPolicyExportExtension
  39. {
  40. int max_session_size;
  41. // FIXME: they might be configurable.
  42. int max_read_pool_size = 64;
  43. int max_write_pool_size = 16;
  44. XmlDictionaryReaderQuotas quotas =
  45. new XmlDictionaryReaderQuotas ();
  46. MessageVersion version = MessageVersion.Default;
  47. public BinaryMessageEncodingBindingElement ()
  48. {
  49. }
  50. private BinaryMessageEncodingBindingElement (
  51. BinaryMessageEncodingBindingElement other)
  52. {
  53. throw new NotImplementedException ();
  54. }
  55. public override MessageVersion MessageVersion {
  56. get { return version; }
  57. set { version = value; }
  58. }
  59. public int MaxSessionSize {
  60. get { return max_session_size; }
  61. set { max_session_size = value; }
  62. }
  63. public int MaxReadPoolSize {
  64. get { return max_read_pool_size; }
  65. set { max_read_pool_size = value; }
  66. }
  67. public int MaxWritePoolSize {
  68. get { return max_write_pool_size; }
  69. set { max_write_pool_size = value; }
  70. }
  71. public XmlDictionaryReaderQuotas ReaderQuotas {
  72. get { return quotas; }
  73. }
  74. public override IChannelFactory<TChannel> BuildChannelFactory<TChannel> (
  75. BindingContext context)
  76. {
  77. if (context == null)
  78. throw new ArgumentNullException ("context");
  79. context.RemainingBindingElements.Add (this);
  80. return base.BuildChannelFactory<TChannel> (context);
  81. }
  82. public override IChannelListener<TChannel> BuildChannelListener<TChannel> (
  83. BindingContext context)
  84. {
  85. if (context == null)
  86. throw new ArgumentNullException ("context");
  87. context.RemainingBindingElements.Add (this);
  88. return base.BuildChannelListener<TChannel> (context);
  89. }
  90. public override bool CanBuildChannelListener<TChannel> (
  91. BindingContext context)
  92. {
  93. if (context == null)
  94. throw new ArgumentNullException ("context");
  95. return context.CanBuildInnerChannelListener<TChannel> ();
  96. }
  97. public override BindingElement Clone ()
  98. {
  99. return new BinaryMessageEncodingBindingElement (this);
  100. }
  101. [MonoTODO]
  102. public override T GetProperty<T> (BindingContext context)
  103. {
  104. throw new NotImplementedException ();
  105. }
  106. public override MessageEncoderFactory
  107. CreateMessageEncoderFactory ()
  108. {
  109. return new BinaryMessageEncoderFactory (this);
  110. }
  111. [MonoTODO]
  112. protected override void OnImportPolicy (XmlElement assertion,
  113. MessageVersion messageVersion,
  114. MetadataImporter exporter,
  115. PolicyConversionContext context)
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. [MonoTODO]
  120. void IWsdlExportExtension.ExportContract (WsdlExporter exporter,
  121. WsdlContractConversionContext context)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. [MonoTODO]
  126. void IWsdlExportExtension.ExportEndpoint (WsdlExporter exporter,
  127. WsdlEndpointConversionContext context)
  128. {
  129. throw new NotImplementedException ();
  130. }
  131. [MonoTODO]
  132. public void ExportPolicy (MetadataExporter exporter,
  133. PolicyConversionContext context)
  134. {
  135. throw new NotImplementedException ();
  136. }
  137. }
  138. }