Просмотр исходного кода

2002-08-06 Tim Coleman <[email protected]>
* ServiceDescription.cs:
Add namespace definitions when serializing.
* HttpBinding.cs:
Change namespace definition (wsdl was spelt wsld)

svn path=/trunk/mcs/; revision=6488

Tim Coleman 23 лет назад
Родитель
Сommit
caff4ab4f8

+ 6 - 0
mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog

@@ -1,3 +1,9 @@
+2002-08-06  Tim Coleman <[email protected]>
+	* ServiceDescription.cs:
+		Add namespace definitions when serializing.
+	* HttpBinding.cs:
+		Change namespace definition (wsdl was spelt wsld)
+
 2002-08-06  Tim Coleman <[email protected]>
 	* ServiceDescription.cs:
 		Change the XmlElement name from "type" to "types" for

+ 1 - 1
mcs/class/System.Web.Services/System.Web.Services.Description/HttpBinding.cs

@@ -12,7 +12,7 @@ using System.Xml.Serialization;
 
 namespace System.Web.Services.Description {
 	[XmlFormatExtension ("binding", "http://schemas.xmlsoap.org/wsdl/http/", typeof (Binding))]
-	[XmlFormatExtensionPrefix ("http", "http://schemas.xmlsoap.org/wsld/http/")]
+	[XmlFormatExtensionPrefix ("http", "http://schemas.xmlsoap.org/wsdl/http/")]
 	public sealed class HttpBinding : ServiceDescriptionFormatExtension {
 
 		#region Fields

+ 13 - 6
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescription.cs

@@ -11,6 +11,7 @@ using System.IO;
 using System.Web.Services;
 using System.Web.Services.Configuration;
 using System.Xml;
+using System.Xml.Schema;
 using System.Xml.Serialization;
 
 namespace System.Web.Services.Description {
@@ -34,7 +35,7 @@ namespace System.Web.Services.Description {
 		string targetNamespace;
 		Types types;
 		static XmlSerializer serializer;
-
+		XmlSerializerNamespaces ns;
 
 		#endregion // Fields
 
@@ -53,13 +54,18 @@ namespace System.Web.Services.Description {
 			messages = new MessageCollection (this);
 			name = String.Empty;		
 			portTypes = new PortTypeCollection (this);
-			retrievalUrl = String.Empty;
-
 
 			serviceDescriptions = null;
 			services = new ServiceCollection (this);
 			targetNamespace = String.Empty;
 			types = null;
+
+			ns = new XmlSerializerNamespaces ();
+			ns.Add ("soap", SoapBinding.Namespace);
+			ns.Add ("s", XmlSchema.Namespace);
+			ns.Add ("http", HttpBinding.Namespace);
+			ns.Add ("mime", MimeContentBinding.Namespace);
+			ns.Add ("tm", MimeTextBinding.Namespace);
 		}
 		
 		#endregion // Constructors
@@ -165,7 +171,8 @@ namespace System.Web.Services.Description {
 
 		public void Write (Stream stream)
 		{
-			serializer.Serialize (stream, this);
+
+			serializer.Serialize (stream, this, ns);
 		}
 
 		public void Write (string fileName)
@@ -175,12 +182,12 @@ namespace System.Web.Services.Description {
 
 		public void Write (TextWriter writer)
 		{
-			serializer.Serialize (writer, this);
+			serializer.Serialize (writer, this, ns);
 		}
 
 		public void Write (XmlWriter writer)
 		{
-			serializer.Serialize (writer, this);
+			serializer.Serialize (writer, this, ns);
 		}
 
 		internal void SetParent (ServiceDescriptionCollection serviceDescriptions)