SoapBodyBinding.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // System.Web.Services.Description.SoapBodyBinding.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.ComponentModel;
  10. using System.Web.Services.Configuration;
  11. using System.Xml.Serialization;
  12. namespace System.Web.Services.Description {
  13. [XmlFormatExtension ("body", "http://schemas.xmlsoap.org/wsdl/soap/", typeof (InputBinding), typeof (OutputBinding), typeof (MimePart))]
  14. public sealed class SoapBodyBinding : ServiceDescriptionFormatExtension {
  15. #region Fields
  16. string encoding;
  17. string ns;
  18. string[] parts;
  19. string partsString;
  20. SoapBindingUse use;
  21. #endregion // Fields
  22. #region Constructors
  23. public SoapBodyBinding ()
  24. {
  25. encoding = String.Empty;
  26. ns = String.Empty;
  27. parts = null;
  28. partsString = null;
  29. use = SoapBindingUse.Default;
  30. }
  31. #endregion // Constructors
  32. #region Properties
  33. [DefaultValue ("")]
  34. [XmlAttribute ("encodingStyle")]
  35. public string Encoding {
  36. get { return encoding; }
  37. set { encoding = value; }
  38. }
  39. [DefaultValue ("")]
  40. [XmlAttribute ("namespace")]
  41. public string Namespace {
  42. get { return ns; }
  43. set { ns = value; }
  44. }
  45. [XmlIgnore]
  46. public string[] Parts {
  47. get { return parts; }
  48. set {
  49. parts = value;
  50. if (value == null)
  51. partsString = null;
  52. else
  53. partsString = String.Join(" ", value);
  54. }
  55. }
  56. [XmlAttribute ("parts", DataType = "NMTOKENS")]
  57. public string PartsString {
  58. get { return partsString; }
  59. set {
  60. partsString = value;
  61. if (value == null)
  62. parts = null;
  63. else
  64. parts = value.Split(' ');
  65. }
  66. }
  67. [DefaultValue (SoapBindingUse.Default)]
  68. [XmlAttribute ("use")]
  69. public SoapBindingUse Use {
  70. get { return use; }
  71. set { use = value; }
  72. }
  73. #endregion // Properties
  74. }
  75. }