Преглед на файлове

In class/System.Web.Services/Test/System.Web.Services.Description:

	* ServiceDescriptionTest.cs (Namespaces): New.

In class/System.Web.Services/System.Web.Services.Description:

	* wsdl.genxs: Remove readerhooks for "unknownAttribute" and
	"attributes".
	* ServiceDescription.cs (ServiceDescription.AddUnknownAttribute):
	(ServiceDescription.SetExtensibleAttributes): Remove.
	* ServiceDescriptionSerializerBase.cs: Regenerated with genxs (for
	!NET_2_0 profile)
	* ServiceDescriptionSerializerBase2.cs: Generated with genxs2 (for
	NET_2_0 profile)

In class/System.Web.Services:

	* System.Web.Services.dll.sources: Add
	ServiceDescriptionSerializerBase2.cs


svn path=/trunk/mcs/; revision=64937
Ankit Jain преди 19 години
родител
ревизия
9df1ff50f2

+ 5 - 0
mcs/class/System.Web.Services/ChangeLog

@@ -1,3 +1,8 @@
+2006-09-05  Ankit Jain  <[email protected]>
+
+	* System.Web.Services.dll.sources: Add
+	ServiceDescriptionSerializerBase2.cs
+
 2006-06-16  Raja R Harinath  <[email protected]>
 
 	* Makefile (EXTRA_DISTFILES): New.

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

@@ -1,3 +1,14 @@
+2006-09-05  Ankit Jain  <[email protected]>
+
+	* wsdl.genxs: Remove readerhooks for "unknownAttribute" and
+	"attributes".
+	* ServiceDescription.cs (ServiceDescription.AddUnknownAttribute):
+	(ServiceDescription.SetExtensibleAttributes): Remove.
+	* ServiceDescriptionSerializerBase.cs: Regenerated with genxs (for
+	!NET_2_0 profile)
+	* ServiceDescriptionSerializerBase2.cs: Generated with genxs2 (for
+	NET_2_0 profile)
+
 2006-09-05  Lluis Sanchez Gual <[email protected]>
 
 	* BasicProfileChecker.cs: In FindMessage, get faults messages from the

+ 0 - 33
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescription.cs

@@ -71,9 +71,6 @@ namespace System.Web.Services.Description
 		string targetNamespace;
 		Types types;
 		static ServiceDescriptionSerializer serializer;
-#if NET_2_0
-		internal static List<XmlAttribute> extensible_attributes;
-#endif
 
 		#endregion // Fields
 
@@ -332,36 +329,6 @@ namespace System.Web.Services.Description
 			reader.Skip ();
 #endif
 		}
-
-#if NET_2_0
-		internal static void AddUnknownAttribute (XmlAttribute xa)
-		{
-			if (extensible_attributes == null)
-				extensible_attributes = new List<XmlAttribute> ();
-
-			extensible_attributes.Add (xa);
-		}
-
-		internal static void SetExtensibleAttributes (object ob)
-		{
-			if (extensible_attributes == null)
-				return;
-
-			DocumentableItem item = ob as DocumentableItem;
-			if (item == null)
-				return;
-
-#if TARGET_JVM //No support for 'new T()' in generics yet.
-			XmlAttribute[] array = new XmlAttribute[extensible_attributes.Count];
-			extensible_attributes.CopyTo (array);
-			item.ExtensibleAttributes = array;
-#else
-			item.ExtensibleAttributes = extensible_attributes.ToArray ();
-#endif
-			extensible_attributes.Clear ();
-		}
-#endif
-
 
 		#endregion
 

+ 4 - 119
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase.cs

@@ -19,6 +19,9 @@
 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
+
+#if !NET_2_0
+
 using System;
 using System.Xml;
 using System.Xml.Schema;
@@ -68,17 +71,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -185,17 +181,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -266,17 +255,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -347,17 +329,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -431,17 +406,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -504,17 +472,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -582,17 +543,10 @@ namespace System.Web.Services.Description
 				if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -666,17 +620,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -742,17 +689,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -816,17 +756,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -911,17 +844,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1010,17 +936,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1083,17 +1002,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1156,17 +1068,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1226,17 +1131,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1296,17 +1194,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -1366,17 +1257,10 @@ namespace System.Web.Services.Description
 				else if (IsXmlnsAttribute (Reader.Name)) {
 				}
 				else {
-					#if NET_2_0
-					ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-					#else
 					UnknownNode (ob);
-					#endif
 				}
 			}
 
-			#if NET_2_0
-			ServiceDescription.SetExtensibleAttributes (ob);
-			#endif
 			Reader.MoveToElement();
 			if (Reader.IsEmptyElement) {
 				Reader.Skip ();
@@ -2183,3 +2067,4 @@ namespace System.Web.Services.Description
 
 }
 
+#endif

+ 2538 - 0
mcs/class/System.Web.Services/System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs

@@ -0,0 +1,2538 @@
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+#if NET_2_0
+
+using System;
+using System.Xml;
+using System.Xml.Schema;
+using System.Xml.Serialization;
+using System.Text;
+using System.Collections;
+using System.Globalization;
+
+namespace System.Web.Services.Description
+{
+	internal class ServiceDescriptionReaderBase : XmlSerializationReader
+	{
+		public object ReadRoot_ServiceDescription ()
+		{
+			Reader.MoveToContent();
+			if (Reader.LocalName != "definitions" || Reader.NamespaceURI != "http://schemas.xmlsoap.org/wsdl/")
+				throw CreateUnknownNodeException();
+			return ReadObject_ServiceDescription (true, true);
+		}
+
+		public System.Web.Services.Description.ServiceDescription ReadObject_ServiceDescription (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.ServiceDescription ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "ServiceDescription" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.ServiceDescription ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "targetNamespace" && Reader.NamespaceURI == "") {
+					ob.@TargetNamespace = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b0=false, b1=false, b2=false, b3=false, b4=false, b5=false, b6=false;
+
+			System.Web.Services.Description.ImportCollection o8;
+			o8 = ob.@Imports;
+			System.Web.Services.Description.MessageCollection o10;
+			o10 = ob.@Messages;
+			System.Web.Services.Description.PortTypeCollection o12;
+			o12 = ob.@PortTypes;
+			System.Web.Services.Description.BindingCollection o14;
+			o14 = ob.@Bindings;
+			System.Web.Services.Description.ServiceCollection o16;
+			o16 = ob.@Services;
+			int n7=0, n9=0, n11=0, n13=0, n15=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b0) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "service" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b6) {
+						if (((object)o16) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ServiceCollection");
+						o16.Add (ReadObject_Service (false, true));
+						n15++;
+					}
+					else if (Reader.LocalName == "message" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b3) {
+						if (((object)o10) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessageCollection");
+						o10.Add (ReadObject_Message (false, true));
+						n9++;
+					}
+					else if (Reader.LocalName == "portType" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b4) {
+						if (((object)o12) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortTypeCollection");
+						o12.Add (ReadObject_PortType (false, true));
+						n11++;
+					}
+					else if (Reader.LocalName == "import" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b1) {
+						if (((object)o8) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ImportCollection");
+						o8.Add (ReadObject_Import (false, true));
+						n7++;
+					}
+					else if (Reader.LocalName == "binding" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b5) {
+						if (((object)o14) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.BindingCollection");
+						o14.Add (ReadObject_Binding (false, true));
+						n13++;
+					}
+					else if (Reader.LocalName == "types" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b2) {
+						b2 = true;
+						ob.@Types = ReadObject_Types (false, true);
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Service ReadObject_Service (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Service ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Service" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Service ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b17=false, b18=false;
+
+			System.Web.Services.Description.PortCollection o20;
+			o20 = ob.@Ports;
+			int n19=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b17) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "port" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b18) {
+						if (((object)o20) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortCollection");
+						o20.Add (ReadObject_Port (false, true));
+						n19++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Message ReadObject_Message (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Message ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Message" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Message ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b21=false, b22=false;
+
+			System.Web.Services.Description.MessagePartCollection o24;
+			o24 = ob.@Parts;
+			int n23=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b21) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "part" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b22) {
+						if (((object)o24) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessagePartCollection");
+						o24.Add (ReadObject_MessagePart (false, true));
+						n23++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.PortType ReadObject_PortType (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.PortType ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "PortType" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.PortType ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b25=false, b26=false;
+
+			System.Web.Services.Description.OperationCollection o28;
+			o28 = ob.@Operations;
+			int n27=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b25) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b26) {
+						if (((object)o28) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationCollection");
+						o28.Add (ReadObject_Operation (false, true));
+						n27++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Import ReadObject_Import (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Import ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Import" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Import ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "location" && Reader.NamespaceURI == "") {
+					ob.@Location = Reader.Value;
+				}
+				else if (Reader.LocalName == "namespace" && Reader.NamespaceURI == "") {
+					ob.@Namespace = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b29=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b29) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Binding ReadObject_Binding (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Binding ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Binding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Binding ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
+					ob.@Type = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b30=false, b31=false;
+
+			System.Web.Services.Description.OperationBindingCollection o33;
+			o33 = ob.@Operations;
+			int n32=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b30) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b31) {
+						if (((object)o33) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationBindingCollection");
+						o33.Add (ReadObject_OperationBinding (false, true));
+						n32++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Types ReadObject_Types (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Types ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Types" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Types ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b34=false, b35=false;
+
+			System.Xml.Serialization.XmlSchemas o37;
+			o37 = ob.@Schemas;
+			int n36=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b34) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "schema" && Reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema" && !b35) {
+						if (((object)o37) == null)
+							throw CreateReadOnlyCollectionException ("System.Xml.Serialization.XmlSchemas");
+						o37.Add (ReadObject_XmlSchema (false, true));
+						n36++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Port ReadObject_Port (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Port ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Port" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Port ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "binding" && Reader.NamespaceURI == "") {
+					ob.@Binding = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b38=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b38) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.MessagePart ReadObject_MessagePart (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.MessagePart ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "MessagePart" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.MessagePart ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "element" && Reader.NamespaceURI == "") {
+					ob.@Element = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
+					ob.@Type = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b39=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b39) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.Operation ReadObject_Operation (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.Operation ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "Operation" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.Operation ();
+
+			Reader.MoveToElement();
+
+			ob.@ParameterOrderString = "";
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "parameterOrder" && Reader.NamespaceURI == "") {
+					ob.@ParameterOrderString = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b40=false, b41=false, b42=false;
+
+			System.Web.Services.Description.OperationFaultCollection o44;
+			o44 = ob.@Faults;
+			System.Web.Services.Description.OperationMessageCollection o46;
+			o46 = ob.@Messages;
+			int n43=0, n45=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b40) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b41) {
+						if (((object)o44) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationFaultCollection");
+						o44.Add (ReadObject_OperationFault (false, true));
+						n43++;
+					}
+					else if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b42) {
+						if (((object)o46) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
+						o46.Add (ReadObject_OperationInput (false, true));
+						n45++;
+					}
+					else if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b42) {
+						if (((object)o46) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
+						o46.Add (ReadObject_OperationOutput (false, true));
+						n45++;
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.OperationBinding ReadObject_OperationBinding (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.OperationBinding ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "OperationBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.OperationBinding ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b47=false, b48=false, b49=false, b50=false;
+
+			System.Web.Services.Description.FaultBindingCollection o52;
+			o52 = ob.@Faults;
+			int n51=0;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b47) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b48) {
+						if (((object)o52) == null)
+							throw CreateReadOnlyCollectionException ("System.Web.Services.Description.FaultBindingCollection");
+						o52.Add (ReadObject_FaultBinding (false, true));
+						n51++;
+					}
+					else if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b49) {
+						b49 = true;
+						ob.@Input = ReadObject_InputBinding (false, true);
+					}
+					else if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b50) {
+						b50 = true;
+						ob.@Output = ReadObject_OutputBinding (false, true);
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Xml.Schema.XmlSchema ReadObject_XmlSchema (bool isNullable, bool checkType)
+		{
+			System.Xml.Schema.XmlSchema ob = null;
+			ob = System.Xml.Schema.XmlSchema.Read (Reader, null); Reader.Read ();
+			return ob;
+		}
+
+		public System.Web.Services.Description.OperationFault ReadObject_OperationFault (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.OperationFault ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "OperationFault" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.OperationFault ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
+					ob.@Message = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b53=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b53) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.OperationInput ReadObject_OperationInput (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.OperationInput ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "OperationInput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.OperationInput ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
+					ob.@Message = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b54=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b54) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.OperationOutput ReadObject_OperationOutput (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.OperationOutput ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "OperationOutput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.OperationOutput ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
+					ob.@Message = ToXmlQualifiedName (Reader.Value);
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b55=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b55) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.FaultBinding ReadObject_FaultBinding (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.FaultBinding ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "FaultBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.FaultBinding ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b56=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b56) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.InputBinding ReadObject_InputBinding (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.InputBinding ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "InputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.InputBinding ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b57=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b57) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		public System.Web.Services.Description.OutputBinding ReadObject_OutputBinding (bool isNullable, bool checkType)
+		{
+			System.Web.Services.Description.OutputBinding ob = null;
+			if (isNullable && ReadNull()) return null;
+
+			if (checkType) 
+			{
+				System.Xml.XmlQualifiedName t = GetXsiType();
+				if (t == null)
+				{ }
+				else if (t.Name != "OutputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
+					throw CreateUnknownTypeException(t);
+			}
+
+			ob = new System.Web.Services.Description.OutputBinding ();
+
+			Reader.MoveToElement();
+
+			int anyAttributeIndex = 0;
+			System.Xml.XmlAttribute[] anyAttributeArray = null;
+			while (Reader.MoveToNextAttribute())
+			{
+				if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
+					ob.@Name = Reader.Value;
+				}
+				else if (IsXmlnsAttribute (Reader.Name)) {
+					if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
+					if (Reader.Prefix == "xmlns")
+						[email protected] (Reader.LocalName, Reader.Value);
+					else
+						[email protected] ("", Reader.Value);
+				}
+				else {
+					System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
+					anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
+					anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
+					anyAttributeIndex++;
+				}
+			}
+
+			anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
+			ob.@ExtensibleAttributes = anyAttributeArray;
+
+			Reader.MoveToElement();
+			if (Reader.IsEmptyElement) {
+				Reader.Skip ();
+				return ob;
+			}
+
+			Reader.ReadStartElement();
+			Reader.MoveToContent();
+
+			bool b58=false;
+
+			while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
+			{
+				if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
+				{
+					if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b58) {
+						ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
+					}
+					else {
+						ServiceDescription.ReadExtension (Document, Reader, ob);
+					}
+				}
+				else
+					UnknownNode(ob);
+
+				Reader.MoveToContent();
+			}
+
+			ReadEndElement();
+
+			return ob;
+		}
+
+		protected override void InitCallbacks ()
+		{
+		}
+
+		protected override void InitIDs ()
+		{
+		}
+
+	}
+
+	internal class ServiceDescriptionWriterBase : XmlSerializationWriter
+	{
+		const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
+		public void WriteRoot_ServiceDescription (object o)
+		{
+			WriteStartDocument ();
+			System.Web.Services.Description.ServiceDescription ob = (System.Web.Services.Description.ServiceDescription) o;
+			TopLevelElement ();
+			WriteObject_ServiceDescription (ob, "definitions", "http://schemas.xmlsoap.org/wsdl/", true, false, true);
+		}
+
+		void WriteObject_ServiceDescription (System.Web.Services.Description.ServiceDescription ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.ServiceDescription))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("ServiceDescription", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o59 = ob.@ExtensibleAttributes;
+			if (o59 != null) {
+				foreach (XmlAttribute o60 in o59)
+					if (o60.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o60, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("targetNamespace", "", ob.@TargetNamespace);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o61 = ob.@DocumentationElement;
+				if (o61 is XmlElement) {
+				if ((o61.Name == "documentation" && o61.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o61.WriteTo (Writer);
+					WriteElementLiteral (o61, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o61.Name, o61.NamespaceURI);
+			}
+			if (ob.@Imports != null) {
+				for (int n62 = 0; n62 < [email protected]; n62++) {
+					WriteObject_Import (ob.@Imports[n62], "import", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			WriteObject_Types (ob.@Types, "types", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+			if (ob.@Messages != null) {
+				for (int n63 = 0; n63 < [email protected]; n63++) {
+					WriteObject_Message (ob.@Messages[n63], "message", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (ob.@PortTypes != null) {
+				for (int n64 = 0; n64 < [email protected]; n64++) {
+					WriteObject_PortType (ob.@PortTypes[n64], "portType", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (ob.@Bindings != null) {
+				for (int n65 = 0; n65 < [email protected]; n65++) {
+					WriteObject_Binding (ob.@Bindings[n65], "binding", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (ob.@Services != null) {
+				for (int n66 = 0; n66 < [email protected]; n66++) {
+					WriteObject_Service (ob.@Services[n66], "service", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Import (System.Web.Services.Description.Import ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Import))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Import", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o67 = ob.@ExtensibleAttributes;
+			if (o67 != null) {
+				foreach (XmlAttribute o68 in o67)
+					if (o68.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o68, ob);
+			}
+
+			WriteAttribute ("location", "", ob.@Location);
+			WriteAttribute ("namespace", "", ob.@Namespace);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o69 = ob.@DocumentationElement;
+				if (o69 is XmlElement) {
+				if ((o69.Name == "documentation" && o69.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o69.WriteTo (Writer);
+					WriteElementLiteral (o69, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o69.Name, o69.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Types (System.Web.Services.Description.Types ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Types))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Types", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o70 = ob.@ExtensibleAttributes;
+			if (o70 != null) {
+				foreach (XmlAttribute o71 in o70)
+					if (o71.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o71, ob);
+			}
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o72 = ob.@DocumentationElement;
+				if (o72 is XmlElement) {
+				if ((o72.Name == "documentation" && o72.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o72.WriteTo (Writer);
+					WriteElementLiteral (o72, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o72.Name, o72.NamespaceURI);
+			}
+			if (ob.@Schemas != null) {
+				for (int n73 = 0; n73 < [email protected]; n73++) {
+					WriteObject_XmlSchema (ob.@Schemas[n73], "schema", "http://www.w3.org/2001/XMLSchema", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Message (System.Web.Services.Description.Message ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Message))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Message", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o74 = ob.@ExtensibleAttributes;
+			if (o74 != null) {
+				foreach (XmlAttribute o75 in o74)
+					if (o75.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o75, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o76 = ob.@DocumentationElement;
+				if (o76 is XmlElement) {
+				if ((o76.Name == "documentation" && o76.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o76.WriteTo (Writer);
+					WriteElementLiteral (o76, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o76.Name, o76.NamespaceURI);
+			}
+			if (ob.@Parts != null) {
+				for (int n77 = 0; n77 < [email protected]; n77++) {
+					WriteObject_MessagePart (ob.@Parts[n77], "part", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_PortType (System.Web.Services.Description.PortType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.PortType))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("PortType", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o78 = ob.@ExtensibleAttributes;
+			if (o78 != null) {
+				foreach (XmlAttribute o79 in o78)
+					if (o79.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o79, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o80 = ob.@DocumentationElement;
+				if (o80 is XmlElement) {
+				if ((o80.Name == "documentation" && o80.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o80.WriteTo (Writer);
+					WriteElementLiteral (o80, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o80.Name, o80.NamespaceURI);
+			}
+			if (ob.@Operations != null) {
+				for (int n81 = 0; n81 < [email protected]; n81++) {
+					WriteObject_Operation (ob.@Operations[n81], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Binding (System.Web.Services.Description.Binding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Binding))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Binding", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o82 = ob.@ExtensibleAttributes;
+			if (o82 != null) {
+				foreach (XmlAttribute o83 in o82)
+					if (o83.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o83, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("type", "", FromXmlQualifiedName (ob.@Type));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o84 = ob.@DocumentationElement;
+				if (o84 is XmlElement) {
+				if ((o84.Name == "documentation" && o84.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o84.WriteTo (Writer);
+					WriteElementLiteral (o84, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o84.Name, o84.NamespaceURI);
+			}
+			if (ob.@Operations != null) {
+				for (int n85 = 0; n85 < [email protected]; n85++) {
+					WriteObject_OperationBinding (ob.@Operations[n85], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Service (System.Web.Services.Description.Service ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Service))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Service", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o86 = ob.@ExtensibleAttributes;
+			if (o86 != null) {
+				foreach (XmlAttribute o87 in o86)
+					if (o87.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o87, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o88 = ob.@DocumentationElement;
+				if (o88 is XmlElement) {
+				if ((o88.Name == "documentation" && o88.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o88.WriteTo (Writer);
+					WriteElementLiteral (o88, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o88.Name, o88.NamespaceURI);
+			}
+			if (ob.@Ports != null) {
+				for (int n89 = 0; n89 < [email protected]; n89++) {
+					WriteObject_Port (ob.@Ports[n89], "port", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_XmlSchema (System.Xml.Schema.XmlSchema ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			ob.Write (Writer);
+		}
+
+		void WriteObject_MessagePart (System.Web.Services.Description.MessagePart ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.MessagePart))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("MessagePart", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o90 = ob.@ExtensibleAttributes;
+			if (o90 != null) {
+				foreach (XmlAttribute o91 in o90)
+					if (o91.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o91, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("element", "", FromXmlQualifiedName (ob.@Element));
+			WriteAttribute ("type", "", FromXmlQualifiedName (ob.@Type));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o92 = ob.@DocumentationElement;
+				if (o92 is XmlElement) {
+				if ((o92.Name == "documentation" && o92.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o92.WriteTo (Writer);
+					WriteElementLiteral (o92, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o92.Name, o92.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Operation (System.Web.Services.Description.Operation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Operation))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Operation", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o93 = ob.@ExtensibleAttributes;
+			if (o93 != null) {
+				foreach (XmlAttribute o94 in o93)
+					if (o94.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o94, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			if (ob.@ParameterOrderString != "") {
+				WriteAttribute ("parameterOrder", "", ob.@ParameterOrderString);
+			}
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o95 = ob.@DocumentationElement;
+				if (o95 is XmlElement) {
+				if ((o95.Name == "documentation" && o95.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o95.WriteTo (Writer);
+					WriteElementLiteral (o95, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o95.Name, o95.NamespaceURI);
+			}
+			if (ob.@Faults != null) {
+				for (int n96 = 0; n96 < [email protected]; n96++) {
+					WriteObject_OperationFault (ob.@Faults[n96], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			if (ob.@Messages != null) {
+				for (int n97 = 0; n97 < [email protected]; n97++) {
+					if (((object)ob.@Messages[n97]) == null) { }
+					else if (ob.@Messages[n97].GetType() == typeof(System.Web.Services.Description.OperationInput)) {
+						WriteObject_OperationInput (((System.Web.Services.Description.OperationInput) ob.@Messages[n97]), "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+					}
+					else if (ob.@Messages[n97].GetType() == typeof(System.Web.Services.Description.OperationOutput)) {
+						WriteObject_OperationOutput (((System.Web.Services.Description.OperationOutput) ob.@Messages[n97]), "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+					}
+					else throw CreateUnknownTypeException (ob.@Messages[n97]);
+				}
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_OperationBinding (System.Web.Services.Description.OperationBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.OperationBinding))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("OperationBinding", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o98 = ob.@ExtensibleAttributes;
+			if (o98 != null) {
+				foreach (XmlAttribute o99 in o98)
+					if (o99.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o99, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o100 = ob.@DocumentationElement;
+				if (o100 is XmlElement) {
+				if ((o100.Name == "documentation" && o100.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o100.WriteTo (Writer);
+					WriteElementLiteral (o100, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o100.Name, o100.NamespaceURI);
+			}
+			if (ob.@Faults != null) {
+				for (int n101 = 0; n101 < [email protected]; n101++) {
+					WriteObject_FaultBinding (ob.@Faults[n101], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+				}
+			}
+			WriteObject_InputBinding (ob.@Input, "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+			WriteObject_OutputBinding (ob.@Output, "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_Port (System.Web.Services.Description.Port ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.Port))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("Port", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o102 = ob.@ExtensibleAttributes;
+			if (o102 != null) {
+				foreach (XmlAttribute o103 in o102)
+					if (o103.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o103, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("binding", "", FromXmlQualifiedName (ob.@Binding));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o104 = ob.@DocumentationElement;
+				if (o104 is XmlElement) {
+				if ((o104.Name == "documentation" && o104.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o104.WriteTo (Writer);
+					WriteElementLiteral (o104, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o104.Name, o104.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_OperationFault (System.Web.Services.Description.OperationFault ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.OperationFault))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("OperationFault", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o105 = ob.@ExtensibleAttributes;
+			if (o105 != null) {
+				foreach (XmlAttribute o106 in o105)
+					if (o106.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o106, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o107 = ob.@DocumentationElement;
+				if (o107 is XmlElement) {
+				if ((o107.Name == "documentation" && o107.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o107.WriteTo (Writer);
+					WriteElementLiteral (o107, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o107.Name, o107.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_OperationInput (System.Web.Services.Description.OperationInput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.OperationInput))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("OperationInput", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o108 = ob.@ExtensibleAttributes;
+			if (o108 != null) {
+				foreach (XmlAttribute o109 in o108)
+					if (o109.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o109, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o110 = ob.@DocumentationElement;
+				if (o110 is XmlElement) {
+				if ((o110.Name == "documentation" && o110.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o110.WriteTo (Writer);
+					WriteElementLiteral (o110, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o110.Name, o110.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_OperationOutput (System.Web.Services.Description.OperationOutput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.OperationOutput))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("OperationOutput", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o111 = ob.@ExtensibleAttributes;
+			if (o111 != null) {
+				foreach (XmlAttribute o112 in o111)
+					if (o112.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o112, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+			WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o113 = ob.@DocumentationElement;
+				if (o113 is XmlElement) {
+				if ((o113.Name == "documentation" && o113.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o113.WriteTo (Writer);
+					WriteElementLiteral (o113, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o113.Name, o113.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_FaultBinding (System.Web.Services.Description.FaultBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.FaultBinding))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("FaultBinding", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o114 = ob.@ExtensibleAttributes;
+			if (o114 != null) {
+				foreach (XmlAttribute o115 in o114)
+					if (o115.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o115, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o116 = ob.@DocumentationElement;
+				if (o116 is XmlElement) {
+				if ((o116.Name == "documentation" && o116.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o116.WriteTo (Writer);
+					WriteElementLiteral (o116, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o116.Name, o116.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_InputBinding (System.Web.Services.Description.InputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.InputBinding))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("InputBinding", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o117 = ob.@ExtensibleAttributes;
+			if (o117 != null) {
+				foreach (XmlAttribute o118 in o117)
+					if (o118.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o118, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o119 = ob.@DocumentationElement;
+				if (o119 is XmlElement) {
+				if ((o119.Name == "documentation" && o119.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o119.WriteTo (Writer);
+					WriteElementLiteral (o119, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o119.Name, o119.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		void WriteObject_OutputBinding (System.Web.Services.Description.OutputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
+		{
+			if (((object)ob) == null)
+			{
+				if (isNullable)
+					WriteNullTagLiteral(element, namesp);
+				return;
+			}
+
+			System.Type type = ob.GetType ();
+			if (type == typeof(System.Web.Services.Description.OutputBinding))
+			{ }
+			else {
+				throw CreateUnknownTypeException (ob);
+			}
+
+			if (writeWrappingElem) {
+				WriteStartElement (element, namesp, ob);
+			}
+
+			if (needType) WriteXsiType("OutputBinding", "http://schemas.xmlsoap.org/wsdl/");
+
+			WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
+
+			ICollection o120 = ob.@ExtensibleAttributes;
+			if (o120 != null) {
+				foreach (XmlAttribute o121 in o120)
+					if (o121.NamespaceURI != xmlNamespace)
+						WriteXmlAttribute (o121, ob);
+			}
+
+			WriteAttribute ("name", "", ob.@Name);
+
+			ServiceDescription.WriteExtensions (Writer, ob);
+			if (ob.@DocumentationElement != null) {
+				XmlNode o122 = ob.@DocumentationElement;
+				if (o122 is XmlElement) {
+				if ((o122.Name == "documentation" && o122.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
+					}
+					else o122.WriteTo (Writer);
+					WriteElementLiteral (o122, "", "", false, true);
+				}
+				else
+					throw CreateUnknownAnyElementException (o122.Name, o122.NamespaceURI);
+			}
+			if (writeWrappingElem) WriteEndElement (ob);
+		}
+
+		protected override void InitCallbacks ()
+		{
+		}
+
+	}
+
+
+	public class BaseXmlSerializer : System.Xml.Serialization.XmlSerializer
+	{
+		protected override System.Xml.Serialization.XmlSerializationReader CreateReader () {
+			return new ServiceDescriptionReaderBase ();
+		}
+
+		protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter () {
+			return new ServiceDescriptionWriterBase ();
+		}
+
+		public override bool CanDeserialize (System.Xml.XmlReader xmlReader) {
+			return true;
+		}
+	}
+
+	public sealed class definitionsSerializer : BaseXmlSerializer
+	{
+		protected override void Serialize (object obj, System.Xml.Serialization.XmlSerializationWriter writer) {
+			((ServiceDescriptionWriterBase)writer).WriteRoot_ServiceDescription(obj);
+		}
+
+		protected override object Deserialize (System.Xml.Serialization.XmlSerializationReader reader) {
+			return ((ServiceDescriptionReaderBase)reader).ReadRoot_ServiceDescription();
+		}
+	}
+
+	public class XmlSerializerContract : System.Xml.Serialization.IXmlSerializerImplementation
+	{
+		System.Collections.Hashtable readMethods = null;
+		System.Collections.Hashtable writeMethods = null;
+		System.Collections.Hashtable typedSerializers = null;
+
+		public System.Xml.Serialization.XmlSerializationReader Reader {
+			get {
+				return new ServiceDescriptionReaderBase();
+			}
+		}
+
+		public System.Xml.Serialization.XmlSerializationWriter Writer {
+			get {
+				return new ServiceDescriptionWriterBase();
+			}
+		}
+
+		public System.Collections.Hashtable ReadMethods {
+			get {
+				lock (System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {
+					if (readMethods == null) {
+						readMethods = new System.Collections.Hashtable ();
+						readMethods.Add (@"", @"ReadRoot_ServiceDescription");
+					}
+					return readMethods;
+				}
+			}
+		}
+
+		public System.Collections.Hashtable WriteMethods {
+			get {
+				lock (System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {
+					if (writeMethods == null) {
+						writeMethods = new System.Collections.Hashtable ();
+						writeMethods.Add (@"", @"WriteRoot_ServiceDescription");
+					}
+					return writeMethods;
+				}
+			}
+		}
+
+		public System.Collections.Hashtable TypedSerializers {
+			get {
+				lock (System.Xml.Serialization.XmlSerializationGeneratedCode.InternalSyncObject) {
+					if (typedSerializers == null) {
+						typedSerializers = new System.Collections.Hashtable ();
+						typedSerializers.Add (@"", new definitionsSerializer());
+					}
+					return typedSerializers;
+				}
+			}
+		}
+		public bool CanSerialize (System.Type type) {
+			if (type == typeof(System.Web.Services.Description.ServiceDescription)) return true;
+			return false;
+		}
+	}
+
+}
+
+#endif

+ 0 - 16
mcs/class/System.Web.Services/System.Web.Services.Description/wsdl.genxs

@@ -9,22 +9,6 @@
 			<hook type="unknownElement">
 				<replace>ServiceDescription.ReadExtension (Document, Reader, $OBJECT);</replace>
 			</hook>
-			<hook type="unknownAttribute">
-				<replace>
-#if NET_2_0
-				ServiceDescription.AddUnknownAttribute ((XmlAttribute) ReadXmlNode (false));
-#else
-				UnknownNode ($OBJECT);
-#endif
-				</replace>
-			</hook>
-			<hook type="attributes">
-				<insertAfter>
-#if NET_2_0
-				ServiceDescription.SetExtensibleAttributes ($OBJECT);
-#endif
-				</insertAfter>
-			</hook>
 			<hook type="type">
 				<select>
 					<typeName>System.Xml.Schema.XmlSchema</typeName>

+ 1 - 0
mcs/class/System.Web.Services/System.Web.Services.dll.sources

@@ -93,6 +93,7 @@ System.Web.Services.Description/ServiceDescriptionImportStyle.cs
 System.Web.Services.Description/ServiceDescriptionImportWarnings.cs
 System.Web.Services.Description/ServiceDescriptionImporter.cs
 System.Web.Services.Description/ServiceDescriptionSerializerBase.cs
+System.Web.Services.Description/ServiceDescriptionSerializerBase2.cs
 System.Web.Services.Description/ServiceDescriptionReflector.cs
 System.Web.Services.Description/ExtensionManager.cs
 System.Web.Services.Description/Soap12AddressBinding.cs

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

@@ -1,3 +1,7 @@
+2006-09-05  Ankit Jain  <[email protected]>
+
+	* ServiceDescriptionTest.cs (Namespaces): New.
+
 2006-05-03  Ankit Jain  <[email protected]>
 
 	* ServiceDescriptionTest.cs (Extensions) New test.

+ 38 - 0
mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionTest.cs

@@ -16,6 +16,7 @@ using System.IO;
 using System.Web.Services.Description;
 using System.Xml;
 using System.Xml.Serialization;
+using System.Collections;
 
 namespace MonoTests.System.Web.Services.Description
 {
@@ -31,6 +32,31 @@ namespace MonoTests.System.Web.Services.Description
 		}
 
 #if NET_2_0
+		[Test]
+		public void Namespaces ()
+		{
+			FileStream fs = new FileStream ("Test/System.Web.Services.Description/test.wsdl", FileMode.Open);
+			XmlTextReader xtr = new XmlTextReader (fs);
+
+			ServiceDescription sd = ServiceDescription.Read (xtr);
+			fs.Close ();
+
+			Assert.IsNotNull (sd.Namespaces);
+			Assert.AreEqual (8, sd.Namespaces.Count, "#n0");
+
+			ArrayList list = new ArrayList (sd.Namespaces.ToArray ());
+			list.Sort (new qname_comparer ());
+
+			Assert.AreEqual (new XmlQualifiedName ("", "http://schemas.xmlsoap.org/wsdl/"), list [0]);
+			Assert.AreEqual (new XmlQualifiedName ("http", "http://schemas.xmlsoap.org/wsdl/http/"), list [1]);
+			Assert.AreEqual (new XmlQualifiedName ("mime", "http://schemas.xmlsoap.org/wsdl/mime/"), list [2]);
+			Assert.AreEqual (new XmlQualifiedName ("s", "http://www.w3.org/2001/XMLSchema"), list [3]);
+			Assert.AreEqual (new XmlQualifiedName ("s0", "http://tempuri.org/"), list [4]);
+			Assert.AreEqual (new XmlQualifiedName ("soap", "http://schemas.xmlsoap.org/wsdl/soap/"), list [5]);
+			Assert.AreEqual (new XmlQualifiedName ("soapenc", "http://schemas.xmlsoap.org/soap/encoding/"), list [6]);
+			Assert.AreEqual (new XmlQualifiedName ("tm", "http://microsoft.com/wsdl/mime/textMatching/"), list [7]);
+		}
+
 		[Test]
 		public void ExtensibleAttributes ()
 		{
@@ -121,5 +147,17 @@ namespace MonoTests.System.Web.Services.Description
 
 #endif
 
+    }
+
+	class qname_comparer : IComparer
+	{
+		public int Compare (object x, object y)
+		{
+			XmlQualifiedName a = (XmlQualifiedName) x;
+			XmlQualifiedName b = (XmlQualifiedName) y;
+
+			return String.Compare (a.Name, b.Name);
+		}
 	}
 }
+