SoapBodyBinding.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. [XmlFormatExtensionPrefixAttribute ("soap", "http://schemas.xmlsoap.org/wsdl/soap/")]
  15. [XmlFormatExtensionPrefixAttribute ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/")]
  16. public class SoapBodyBinding : ServiceDescriptionFormatExtension {
  17. #region Fields
  18. string encoding;
  19. string ns;
  20. string[] parts;
  21. string partsString;
  22. SoapBindingUse use;
  23. #endregion // Fields
  24. #region Constructors
  25. public SoapBodyBinding ()
  26. {
  27. encoding = String.Empty;
  28. ns = String.Empty;
  29. parts = null;
  30. partsString = null;
  31. use = SoapBindingUse.Default;
  32. }
  33. #endregion // Constructors
  34. #region Properties
  35. [DefaultValue ("")]
  36. [XmlAttribute ("encodingStyle")]
  37. public string Encoding {
  38. get { return encoding; }
  39. set { encoding = value; }
  40. }
  41. [DefaultValue ("")]
  42. [XmlAttribute ("namespace")]
  43. public string Namespace {
  44. get { return ns; }
  45. set { ns = value; }
  46. }
  47. [XmlIgnore]
  48. public string[] Parts {
  49. get { return parts; }
  50. set {
  51. parts = value;
  52. if (value == null)
  53. partsString = null;
  54. else
  55. partsString = String.Join(" ", value);
  56. }
  57. }
  58. [XmlAttribute ("parts", DataType = "NMTOKENS")]
  59. public string PartsString {
  60. get { return partsString; }
  61. set {
  62. partsString = value;
  63. if (value == null)
  64. parts = null;
  65. else
  66. parts = value.Split(' ');
  67. }
  68. }
  69. [DefaultValue (SoapBindingUse.Default)]
  70. [XmlAttribute ("use")]
  71. public SoapBindingUse Use {
  72. get { return use; }
  73. set { use = value; }
  74. }
  75. #endregion // Properties
  76. }
  77. }