ServiceDescription.cs 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. //
  2. // System.Web.Services.Description.ServiceDescription.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.IO;
  10. using System.Web.Services;
  11. using System.Web.Services.Configuration;
  12. using System.Xml;
  13. using System.Xml.Serialization;
  14. namespace System.Web.Services.Description {
  15. [XmlFormatExtensionPoint ("Extensions")]
  16. [XmlRoot ("definitions", Namespace = "http://schemas.xmlsoap.org/wsdl/")]
  17. public sealed class ServiceDescription : DocumentableItem {
  18. #region Fields
  19. public const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
  20. BindingCollection bindings;
  21. ServiceDescriptionFormatExtensionCollection extensions;
  22. ImportCollection imports;
  23. MessageCollection messages;
  24. string name;
  25. PortTypeCollection portTypes;
  26. string retrievalUrl;
  27. XmlSerializer serializer;
  28. ServiceDescriptionCollection serviceDescriptions;
  29. ServiceCollection services;
  30. string targetNamespace;
  31. Types types;
  32. #endregion // Fields
  33. #region Constructors
  34. public ServiceDescription ()
  35. {
  36. bindings = new BindingCollection (this);
  37. extensions = new ServiceDescriptionFormatExtensionCollection (this);
  38. imports = new ImportCollection (this);
  39. messages = new MessageCollection (this);
  40. name = String.Empty;
  41. portTypes = new PortTypeCollection (this);
  42. retrievalUrl = String.Empty;
  43. serializer = null;
  44. serviceDescriptions = null;
  45. services = new ServiceCollection (this);
  46. targetNamespace = String.Empty;
  47. types = null;
  48. }
  49. #endregion // Constructors
  50. #region Properties
  51. [XmlElement ("binding")]
  52. public BindingCollection Bindings {
  53. get { return bindings; }
  54. }
  55. [XmlIgnore]
  56. public ServiceDescriptionFormatExtensionCollection Extensions {
  57. get { return extensions; }
  58. }
  59. [XmlElement ("import")]
  60. public ImportCollection Imports {
  61. get { return imports; }
  62. }
  63. [XmlElement ("message")]
  64. public MessageCollection Messages {
  65. get { return messages; }
  66. }
  67. [XmlAttribute ("name", DataType = "NMTOKEN")]
  68. public string Name {
  69. get { return name; }
  70. set { name = value; }
  71. }
  72. [XmlElement ("portType")]
  73. public PortTypeCollection PortTypes {
  74. get { return portTypes; }
  75. }
  76. [XmlIgnore]
  77. public string RetrievalUrl {
  78. get { return retrievalUrl; }
  79. set { retrievalUrl = value; }
  80. }
  81. [XmlIgnore]
  82. public static XmlSerializer Serializer {
  83. [MonoTODO]
  84. get { throw new NotImplementedException (); }
  85. }
  86. [XmlIgnore]
  87. public ServiceDescriptionCollection ServiceDescriptions {
  88. get {
  89. if (serviceDescriptions == null)
  90. throw new NullReferenceException ();
  91. return serviceDescriptions;
  92. }
  93. }
  94. [XmlElement ("service")]
  95. public ServiceCollection Services {
  96. get { return services; }
  97. }
  98. [XmlAttribute ("targetNamespace")]
  99. public string TargetNamespace {
  100. get { return targetNamespace; }
  101. set { targetNamespace = value; }
  102. }
  103. [XmlElement ("type")]
  104. public Types Types {
  105. get { return types; }
  106. set { types = value; }
  107. }
  108. #endregion // Properties
  109. #region Methods
  110. [MonoTODO]
  111. public static bool CanRead (XmlReader reader)
  112. {
  113. throw new NotImplementedException ();
  114. }
  115. [MonoTODO]
  116. public static ServiceDescription Read (Stream stream)
  117. {
  118. throw new NotImplementedException ();
  119. }
  120. [MonoTODO]
  121. public static ServiceDescription Read (string fileName)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. [MonoTODO]
  126. public static ServiceDescription Read (TextReader textReader)
  127. {
  128. throw new NotImplementedException ();
  129. }
  130. [MonoTODO]
  131. public static ServiceDescription Read (XmlReader reader)
  132. {
  133. throw new NotImplementedException ();
  134. }
  135. [MonoTODO]
  136. public void Write (Stream stream)
  137. {
  138. throw new NotImplementedException ();
  139. }
  140. [MonoTODO]
  141. public void Write (string fileName)
  142. {
  143. throw new NotImplementedException ();
  144. }
  145. [MonoTODO]
  146. public void Write (TextWriter writer)
  147. {
  148. throw new NotImplementedException ();
  149. }
  150. [MonoTODO]
  151. public void Write (XmlWriter writer)
  152. {
  153. throw new NotImplementedException ();
  154. }
  155. internal void SetParent (ServiceDescriptionCollection serviceDescriptions)
  156. {
  157. this.serviceDescriptions = serviceDescriptions;
  158. }
  159. #endregion
  160. }
  161. }