[System.Net] Add support for .pac proxy config scripts on mac
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / ServiceDescriptionSerializerBase2.cs
1 #if NET_2_0
2 // It is automatically generated
3 using System;
4 using System.Xml;
5 using System.Xml.Schema;
6 using System.Xml.Serialization;
7 using System.Text;
8 using System.Collections;
9 using System.Globalization;
10
11 namespace System.Web.Services.Description
12 {
13         internal class ServiceDescriptionReaderBase : XmlSerializationReader
14         {
15                 static readonly System.Reflection.MethodInfo fromBinHexStringMethod = typeof (XmlConvert).GetMethod ("FromBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type [] {typeof (string)}, null);
16                 static byte [] FromBinHexString (string input)
17                 {
18                         return input == null ? null : (byte []) fromBinHexStringMethod.Invoke (null, new object [] {input});
19                 }
20                 public object ReadRoot_ServiceDescription ()
21                 {
22                         Reader.MoveToContent();
23                         if (Reader.LocalName != "definitions" || Reader.NamespaceURI != "http://schemas.xmlsoap.org/wsdl/")
24                                 throw CreateUnknownNodeException();
25                         return ReadObject_ServiceDescription (true, true);
26                 }
27
28                 public System.Web.Services.Description.ServiceDescription ReadObject_ServiceDescription (bool isNullable, bool checkType)
29                 {
30                         System.Web.Services.Description.ServiceDescription ob = null;
31                         if (isNullable && ReadNull()) return null;
32
33                         if (checkType) 
34                         {
35                                 System.Xml.XmlQualifiedName t = GetXsiType();
36                                 if (t == null)
37                                 { }
38                                 else if (t.Name != "ServiceDescription" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
39                                         throw CreateUnknownTypeException(t);
40                         }
41
42                         ob = (System.Web.Services.Description.ServiceDescription) Activator.CreateInstance(typeof(System.Web.Services.Description.ServiceDescription), true);
43
44                         Reader.MoveToElement();
45
46                         int anyAttributeIndex = 0;
47                         System.Xml.XmlAttribute[] anyAttributeArray = null;
48                         while (Reader.MoveToNextAttribute())
49                         {
50                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
51                                         ob.@Name = Reader.Value;
52                                 }
53                                 else if (Reader.LocalName == "targetNamespace" && Reader.NamespaceURI == "") {
54                                         ob.@TargetNamespace = Reader.Value;
55                                 }
56                                 else if (IsXmlnsAttribute (Reader.Name)) {
57                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
58                                         if (Reader.Prefix == "xmlns")
59                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
60                                         else
61                                                 ob.@Namespaces.Add ("", Reader.Value);
62                                 }
63                                 else {
64                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
65                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
66                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
67                                         anyAttributeIndex++;
68                                 }
69                         }
70
71                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
72                         ob.@ExtensibleAttributes = anyAttributeArray;
73
74                         Reader.MoveToElement ();
75                         Reader.MoveToElement();
76                         if (Reader.IsEmptyElement) {
77                                 Reader.Skip ();
78                                 return ob;
79                         }
80
81                         Reader.ReadStartElement();
82                         Reader.MoveToContent();
83
84                         bool b0=false, b1=false, b2=false, b3=false, b4=false, b5=false, b6=false;
85
86                         System.Web.Services.Description.ImportCollection o8;
87                         o8 = ob.@Imports;
88                         System.Web.Services.Description.MessageCollection o10;
89                         o10 = ob.@Messages;
90                         System.Web.Services.Description.PortTypeCollection o12;
91                         o12 = ob.@PortTypes;
92                         System.Web.Services.Description.BindingCollection o14;
93                         o14 = ob.@Bindings;
94                         System.Web.Services.Description.ServiceCollection o16;
95                         o16 = ob.@Services;
96                         int n7=0, n9=0, n11=0, n13=0, n15=0;
97
98                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
99                         {
100                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
101                                 {
102                                         if (Reader.LocalName == "types" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b2) {
103                                                 b2 = true;
104                                                 ob.@Types = ReadObject_Types (false, true);
105                                         }
106                                         else if (Reader.LocalName == "service" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b6) {
107                                                 if (((object)o16) == null)
108                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ServiceCollection");
109                                                 o16.Add (ReadObject_Service (false, true));
110                                                 n15++;
111                                         }
112                                         else if (Reader.LocalName == "message" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b3) {
113                                                 if (((object)o10) == null)
114                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessageCollection");
115                                                 o10.Add (ReadObject_Message (false, true));
116                                                 n9++;
117                                         }
118                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b0) {
119                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
120                                         }
121                                         else if (Reader.LocalName == "portType" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b4) {
122                                                 if (((object)o12) == null)
123                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortTypeCollection");
124                                                 o12.Add (ReadObject_PortType (false, true));
125                                                 n11++;
126                                         }
127                                         else if (Reader.LocalName == "import" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b1) {
128                                                 if (((object)o8) == null)
129                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ImportCollection");
130                                                 o8.Add (ReadObject_Import (false, true));
131                                                 n7++;
132                                         }
133                                         else if (Reader.LocalName == "binding" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b5) {
134                                                 if (((object)o14) == null)
135                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.BindingCollection");
136                                                 o14.Add (ReadObject_Binding (false, true));
137                                                 n13++;
138                                         }
139                                         else {
140                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
141                                         }
142                                 }
143                                 else
144                                         UnknownNode(ob);
145
146                                 Reader.MoveToContent();
147                         }
148
149
150                         ReadEndElement();
151
152                         return ob;
153                 }
154
155                 public System.Web.Services.Description.Types ReadObject_Types (bool isNullable, bool checkType)
156                 {
157                         System.Web.Services.Description.Types ob = null;
158                         if (isNullable && ReadNull()) return null;
159
160                         if (checkType) 
161                         {
162                                 System.Xml.XmlQualifiedName t = GetXsiType();
163                                 if (t == null)
164                                 { }
165                                 else if (t.Name != "Types" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
166                                         throw CreateUnknownTypeException(t);
167                         }
168
169                         ob = (System.Web.Services.Description.Types) Activator.CreateInstance(typeof(System.Web.Services.Description.Types), true);
170
171                         Reader.MoveToElement();
172
173                         int anyAttributeIndex = 0;
174                         System.Xml.XmlAttribute[] anyAttributeArray = null;
175                         while (Reader.MoveToNextAttribute())
176                         {
177                                 if (IsXmlnsAttribute (Reader.Name)) {
178                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
179                                         if (Reader.Prefix == "xmlns")
180                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
181                                         else
182                                                 ob.@Namespaces.Add ("", Reader.Value);
183                                 }
184                                 else {
185                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
186                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
187                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
188                                         anyAttributeIndex++;
189                                 }
190                         }
191
192                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
193                         ob.@ExtensibleAttributes = anyAttributeArray;
194
195                         Reader.MoveToElement ();
196                         Reader.MoveToElement();
197                         if (Reader.IsEmptyElement) {
198                                 Reader.Skip ();
199                                 return ob;
200                         }
201
202                         Reader.ReadStartElement();
203                         Reader.MoveToContent();
204
205                         bool b17=false, b18=false;
206
207                         System.Xml.Serialization.XmlSchemas o20;
208                         o20 = ob.@Schemas;
209                         int n19=0;
210
211                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
212                         {
213                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
214                                 {
215                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b17) {
216                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
217                                         }
218                                         else if (Reader.LocalName == "schema" && Reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema" && !b18) {
219                                                 if (((object)o20) == null)
220                                                         throw CreateReadOnlyCollectionException ("System.Xml.Serialization.XmlSchemas");
221                                                 o20.Add (ReadObject_XmlSchema (false, true));
222                                                 n19++;
223                                         }
224                                         else {
225                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
226                                         }
227                                 }
228                                 else
229                                         UnknownNode(ob);
230
231                                 Reader.MoveToContent();
232                         }
233
234
235                         ReadEndElement();
236
237                         return ob;
238                 }
239
240                 public System.Web.Services.Description.Service ReadObject_Service (bool isNullable, bool checkType)
241                 {
242                         System.Web.Services.Description.Service ob = null;
243                         if (isNullable && ReadNull()) return null;
244
245                         if (checkType) 
246                         {
247                                 System.Xml.XmlQualifiedName t = GetXsiType();
248                                 if (t == null)
249                                 { }
250                                 else if (t.Name != "Service" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
251                                         throw CreateUnknownTypeException(t);
252                         }
253
254                         ob = (System.Web.Services.Description.Service) Activator.CreateInstance(typeof(System.Web.Services.Description.Service), true);
255
256                         Reader.MoveToElement();
257
258                         int anyAttributeIndex = 0;
259                         System.Xml.XmlAttribute[] anyAttributeArray = null;
260                         while (Reader.MoveToNextAttribute())
261                         {
262                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
263                                         ob.@Name = Reader.Value;
264                                 }
265                                 else if (IsXmlnsAttribute (Reader.Name)) {
266                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
267                                         if (Reader.Prefix == "xmlns")
268                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
269                                         else
270                                                 ob.@Namespaces.Add ("", Reader.Value);
271                                 }
272                                 else {
273                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
274                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
275                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
276                                         anyAttributeIndex++;
277                                 }
278                         }
279
280                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
281                         ob.@ExtensibleAttributes = anyAttributeArray;
282
283                         Reader.MoveToElement ();
284                         Reader.MoveToElement();
285                         if (Reader.IsEmptyElement) {
286                                 Reader.Skip ();
287                                 return ob;
288                         }
289
290                         Reader.ReadStartElement();
291                         Reader.MoveToContent();
292
293                         bool b21=false, b22=false;
294
295                         System.Web.Services.Description.PortCollection o24;
296                         o24 = ob.@Ports;
297                         int n23=0;
298
299                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
300                         {
301                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
302                                 {
303                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b21) {
304                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
305                                         }
306                                         else if (Reader.LocalName == "port" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b22) {
307                                                 if (((object)o24) == null)
308                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortCollection");
309                                                 o24.Add (ReadObject_Port (false, true));
310                                                 n23++;
311                                         }
312                                         else {
313                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
314                                         }
315                                 }
316                                 else
317                                         UnknownNode(ob);
318
319                                 Reader.MoveToContent();
320                         }
321
322
323                         ReadEndElement();
324
325                         return ob;
326                 }
327
328                 public System.Web.Services.Description.Message ReadObject_Message (bool isNullable, bool checkType)
329                 {
330                         System.Web.Services.Description.Message ob = null;
331                         if (isNullable && ReadNull()) return null;
332
333                         if (checkType) 
334                         {
335                                 System.Xml.XmlQualifiedName t = GetXsiType();
336                                 if (t == null)
337                                 { }
338                                 else if (t.Name != "Message" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
339                                         throw CreateUnknownTypeException(t);
340                         }
341
342                         ob = (System.Web.Services.Description.Message) Activator.CreateInstance(typeof(System.Web.Services.Description.Message), true);
343
344                         Reader.MoveToElement();
345
346                         int anyAttributeIndex = 0;
347                         System.Xml.XmlAttribute[] anyAttributeArray = null;
348                         while (Reader.MoveToNextAttribute())
349                         {
350                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
351                                         ob.@Name = Reader.Value;
352                                 }
353                                 else if (IsXmlnsAttribute (Reader.Name)) {
354                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
355                                         if (Reader.Prefix == "xmlns")
356                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
357                                         else
358                                                 ob.@Namespaces.Add ("", Reader.Value);
359                                 }
360                                 else {
361                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
362                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
363                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
364                                         anyAttributeIndex++;
365                                 }
366                         }
367
368                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
369                         ob.@ExtensibleAttributes = anyAttributeArray;
370
371                         Reader.MoveToElement ();
372                         Reader.MoveToElement();
373                         if (Reader.IsEmptyElement) {
374                                 Reader.Skip ();
375                                 return ob;
376                         }
377
378                         Reader.ReadStartElement();
379                         Reader.MoveToContent();
380
381                         bool b25=false, b26=false;
382
383                         System.Web.Services.Description.MessagePartCollection o28;
384                         o28 = ob.@Parts;
385                         int n27=0;
386
387                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
388                         {
389                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
390                                 {
391                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b25) {
392                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
393                                         }
394                                         else if (Reader.LocalName == "part" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b26) {
395                                                 if (((object)o28) == null)
396                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessagePartCollection");
397                                                 o28.Add (ReadObject_MessagePart (false, true));
398                                                 n27++;
399                                         }
400                                         else {
401                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
402                                         }
403                                 }
404                                 else
405                                         UnknownNode(ob);
406
407                                 Reader.MoveToContent();
408                         }
409
410
411                         ReadEndElement();
412
413                         return ob;
414                 }
415
416                 public System.Web.Services.Description.PortType ReadObject_PortType (bool isNullable, bool checkType)
417                 {
418                         System.Web.Services.Description.PortType ob = null;
419                         if (isNullable && ReadNull()) return null;
420
421                         if (checkType) 
422                         {
423                                 System.Xml.XmlQualifiedName t = GetXsiType();
424                                 if (t == null)
425                                 { }
426                                 else if (t.Name != "PortType" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
427                                         throw CreateUnknownTypeException(t);
428                         }
429
430                         ob = (System.Web.Services.Description.PortType) Activator.CreateInstance(typeof(System.Web.Services.Description.PortType), true);
431
432                         Reader.MoveToElement();
433
434                         int anyAttributeIndex = 0;
435                         System.Xml.XmlAttribute[] anyAttributeArray = null;
436                         while (Reader.MoveToNextAttribute())
437                         {
438                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
439                                         ob.@Name = Reader.Value;
440                                 }
441                                 else if (IsXmlnsAttribute (Reader.Name)) {
442                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
443                                         if (Reader.Prefix == "xmlns")
444                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
445                                         else
446                                                 ob.@Namespaces.Add ("", Reader.Value);
447                                 }
448                                 else {
449                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
450                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
451                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
452                                         anyAttributeIndex++;
453                                 }
454                         }
455
456                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
457                         ob.@ExtensibleAttributes = anyAttributeArray;
458
459                         Reader.MoveToElement ();
460                         Reader.MoveToElement();
461                         if (Reader.IsEmptyElement) {
462                                 Reader.Skip ();
463                                 return ob;
464                         }
465
466                         Reader.ReadStartElement();
467                         Reader.MoveToContent();
468
469                         bool b29=false, b30=false;
470
471                         System.Web.Services.Description.OperationCollection o32;
472                         o32 = ob.@Operations;
473                         int n31=0;
474
475                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
476                         {
477                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
478                                 {
479                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b29) {
480                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
481                                         }
482                                         else if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b30) {
483                                                 if (((object)o32) == null)
484                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationCollection");
485                                                 o32.Add (ReadObject_Operation (false, true));
486                                                 n31++;
487                                         }
488                                         else {
489                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
490                                         }
491                                 }
492                                 else
493                                         UnknownNode(ob);
494
495                                 Reader.MoveToContent();
496                         }
497
498
499                         ReadEndElement();
500
501                         return ob;
502                 }
503
504                 public System.Web.Services.Description.Import ReadObject_Import (bool isNullable, bool checkType)
505                 {
506                         System.Web.Services.Description.Import ob = null;
507                         if (isNullable && ReadNull()) return null;
508
509                         if (checkType) 
510                         {
511                                 System.Xml.XmlQualifiedName t = GetXsiType();
512                                 if (t == null)
513                                 { }
514                                 else if (t.Name != "Import" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
515                                         throw CreateUnknownTypeException(t);
516                         }
517
518                         ob = (System.Web.Services.Description.Import) Activator.CreateInstance(typeof(System.Web.Services.Description.Import), true);
519
520                         Reader.MoveToElement();
521
522                         int anyAttributeIndex = 0;
523                         System.Xml.XmlAttribute[] anyAttributeArray = null;
524                         while (Reader.MoveToNextAttribute())
525                         {
526                                 if (Reader.LocalName == "location" && Reader.NamespaceURI == "") {
527                                         ob.@Location = Reader.Value;
528                                 }
529                                 else if (Reader.LocalName == "namespace" && Reader.NamespaceURI == "") {
530                                         ob.@Namespace = Reader.Value;
531                                 }
532                                 else if (IsXmlnsAttribute (Reader.Name)) {
533                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
534                                         if (Reader.Prefix == "xmlns")
535                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
536                                         else
537                                                 ob.@Namespaces.Add ("", Reader.Value);
538                                 }
539                                 else {
540                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
541                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
542                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
543                                         anyAttributeIndex++;
544                                 }
545                         }
546
547                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
548                         ob.@ExtensibleAttributes = anyAttributeArray;
549
550                         Reader.MoveToElement ();
551                         Reader.MoveToElement();
552                         if (Reader.IsEmptyElement) {
553                                 Reader.Skip ();
554                                 return ob;
555                         }
556
557                         Reader.ReadStartElement();
558                         Reader.MoveToContent();
559
560                         bool b33=false;
561
562                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
563                         {
564                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
565                                 {
566                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b33) {
567                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
568                                         }
569                                         else {
570                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
571                                         }
572                                 }
573                                 else
574                                         UnknownNode(ob);
575
576                                 Reader.MoveToContent();
577                         }
578
579                         ReadEndElement();
580
581                         return ob;
582                 }
583
584                 public System.Web.Services.Description.Binding ReadObject_Binding (bool isNullable, bool checkType)
585                 {
586                         System.Web.Services.Description.Binding ob = null;
587                         if (isNullable && ReadNull()) return null;
588
589                         if (checkType) 
590                         {
591                                 System.Xml.XmlQualifiedName t = GetXsiType();
592                                 if (t == null)
593                                 { }
594                                 else if (t.Name != "Binding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
595                                         throw CreateUnknownTypeException(t);
596                         }
597
598                         ob = (System.Web.Services.Description.Binding) Activator.CreateInstance(typeof(System.Web.Services.Description.Binding), true);
599
600                         Reader.MoveToElement();
601
602                         int anyAttributeIndex = 0;
603                         System.Xml.XmlAttribute[] anyAttributeArray = null;
604                         while (Reader.MoveToNextAttribute())
605                         {
606                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
607                                         ob.@Name = Reader.Value;
608                                 }
609                                 else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
610                                         ob.@Type = ToXmlQualifiedName (Reader.Value);
611                                 }
612                                 else if (IsXmlnsAttribute (Reader.Name)) {
613                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
614                                         if (Reader.Prefix == "xmlns")
615                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
616                                         else
617                                                 ob.@Namespaces.Add ("", Reader.Value);
618                                 }
619                                 else {
620                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
621                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
622                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
623                                         anyAttributeIndex++;
624                                 }
625                         }
626
627                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
628                         ob.@ExtensibleAttributes = anyAttributeArray;
629
630                         Reader.MoveToElement ();
631                         Reader.MoveToElement();
632                         if (Reader.IsEmptyElement) {
633                                 Reader.Skip ();
634                                 return ob;
635                         }
636
637                         Reader.ReadStartElement();
638                         Reader.MoveToContent();
639
640                         bool b34=false, b35=false;
641
642                         System.Web.Services.Description.OperationBindingCollection o37;
643                         o37 = ob.@Operations;
644                         int n36=0;
645
646                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
647                         {
648                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
649                                 {
650                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b34) {
651                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
652                                         }
653                                         else if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b35) {
654                                                 if (((object)o37) == null)
655                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationBindingCollection");
656                                                 o37.Add (ReadObject_OperationBinding (false, true));
657                                                 n36++;
658                                         }
659                                         else {
660                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
661                                         }
662                                 }
663                                 else
664                                         UnknownNode(ob);
665
666                                 Reader.MoveToContent();
667                         }
668
669
670                         ReadEndElement();
671
672                         return ob;
673                 }
674
675                 public System.Xml.Schema.XmlSchema ReadObject_XmlSchema (bool isNullable, bool checkType)
676                 {
677                         System.Xml.Schema.XmlSchema ob = null;
678                         ob = System.Xml.Schema.XmlSchema.Read (Reader, null); Reader.Read ();
679                         return ob;
680                 }
681
682                 public System.Web.Services.Description.Port ReadObject_Port (bool isNullable, bool checkType)
683                 {
684                         System.Web.Services.Description.Port ob = null;
685                         if (isNullable && ReadNull()) return null;
686
687                         if (checkType) 
688                         {
689                                 System.Xml.XmlQualifiedName t = GetXsiType();
690                                 if (t == null)
691                                 { }
692                                 else if (t.Name != "Port" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
693                                         throw CreateUnknownTypeException(t);
694                         }
695
696                         ob = (System.Web.Services.Description.Port) Activator.CreateInstance(typeof(System.Web.Services.Description.Port), true);
697
698                         Reader.MoveToElement();
699
700                         int anyAttributeIndex = 0;
701                         System.Xml.XmlAttribute[] anyAttributeArray = null;
702                         while (Reader.MoveToNextAttribute())
703                         {
704                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
705                                         ob.@Name = Reader.Value;
706                                 }
707                                 else if (Reader.LocalName == "binding" && Reader.NamespaceURI == "") {
708                                         ob.@Binding = ToXmlQualifiedName (Reader.Value);
709                                 }
710                                 else if (IsXmlnsAttribute (Reader.Name)) {
711                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
712                                         if (Reader.Prefix == "xmlns")
713                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
714                                         else
715                                                 ob.@Namespaces.Add ("", Reader.Value);
716                                 }
717                                 else {
718                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
719                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
720                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
721                                         anyAttributeIndex++;
722                                 }
723                         }
724
725                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
726                         ob.@ExtensibleAttributes = anyAttributeArray;
727
728                         Reader.MoveToElement ();
729                         Reader.MoveToElement();
730                         if (Reader.IsEmptyElement) {
731                                 Reader.Skip ();
732                                 return ob;
733                         }
734
735                         Reader.ReadStartElement();
736                         Reader.MoveToContent();
737
738                         bool b38=false;
739
740                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
741                         {
742                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
743                                 {
744                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b38) {
745                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
746                                         }
747                                         else {
748                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
749                                         }
750                                 }
751                                 else
752                                         UnknownNode(ob);
753
754                                 Reader.MoveToContent();
755                         }
756
757                         ReadEndElement();
758
759                         return ob;
760                 }
761
762                 public System.Web.Services.Description.MessagePart ReadObject_MessagePart (bool isNullable, bool checkType)
763                 {
764                         System.Web.Services.Description.MessagePart ob = null;
765                         if (isNullable && ReadNull()) return null;
766
767                         if (checkType) 
768                         {
769                                 System.Xml.XmlQualifiedName t = GetXsiType();
770                                 if (t == null)
771                                 { }
772                                 else if (t.Name != "MessagePart" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
773                                         throw CreateUnknownTypeException(t);
774                         }
775
776                         ob = (System.Web.Services.Description.MessagePart) Activator.CreateInstance(typeof(System.Web.Services.Description.MessagePart), true);
777
778                         Reader.MoveToElement();
779
780                         int anyAttributeIndex = 0;
781                         System.Xml.XmlAttribute[] anyAttributeArray = null;
782                         while (Reader.MoveToNextAttribute())
783                         {
784                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
785                                         ob.@Name = Reader.Value;
786                                 }
787                                 else if (Reader.LocalName == "element" && Reader.NamespaceURI == "") {
788                                         ob.@Element = ToXmlQualifiedName (Reader.Value);
789                                 }
790                                 else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
791                                         ob.@Type = ToXmlQualifiedName (Reader.Value);
792                                 }
793                                 else if (IsXmlnsAttribute (Reader.Name)) {
794                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
795                                         if (Reader.Prefix == "xmlns")
796                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
797                                         else
798                                                 ob.@Namespaces.Add ("", Reader.Value);
799                                 }
800                                 else {
801                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
802                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
803                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
804                                         anyAttributeIndex++;
805                                 }
806                         }
807
808                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
809                         ob.@ExtensibleAttributes = anyAttributeArray;
810
811                         Reader.MoveToElement ();
812                         Reader.MoveToElement();
813                         if (Reader.IsEmptyElement) {
814                                 Reader.Skip ();
815                                 return ob;
816                         }
817
818                         Reader.ReadStartElement();
819                         Reader.MoveToContent();
820
821                         bool b39=false;
822
823                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
824                         {
825                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
826                                 {
827                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b39) {
828                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
829                                         }
830                                         else {
831                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
832                                         }
833                                 }
834                                 else
835                                         UnknownNode(ob);
836
837                                 Reader.MoveToContent();
838                         }
839
840                         ReadEndElement();
841
842                         return ob;
843                 }
844
845                 public System.Web.Services.Description.Operation ReadObject_Operation (bool isNullable, bool checkType)
846                 {
847                         System.Web.Services.Description.Operation ob = null;
848                         if (isNullable && ReadNull()) return null;
849
850                         if (checkType) 
851                         {
852                                 System.Xml.XmlQualifiedName t = GetXsiType();
853                                 if (t == null)
854                                 { }
855                                 else if (t.Name != "Operation" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
856                                         throw CreateUnknownTypeException(t);
857                         }
858
859                         ob = (System.Web.Services.Description.Operation) Activator.CreateInstance(typeof(System.Web.Services.Description.Operation), true);
860
861                         Reader.MoveToElement();
862
863                         int anyAttributeIndex = 0;
864                         System.Xml.XmlAttribute[] anyAttributeArray = null;
865                         while (Reader.MoveToNextAttribute())
866                         {
867                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
868                                         ob.@Name = Reader.Value;
869                                 }
870                                 else if (Reader.LocalName == "parameterOrder" && Reader.NamespaceURI == "") {
871                                         ob.@ParameterOrderString = Reader.Value;
872                                 }
873                                 else if (IsXmlnsAttribute (Reader.Name)) {
874                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
875                                         if (Reader.Prefix == "xmlns")
876                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
877                                         else
878                                                 ob.@Namespaces.Add ("", Reader.Value);
879                                 }
880                                 else {
881                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
882                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
883                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
884                                         anyAttributeIndex++;
885                                 }
886                         }
887
888                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
889                         ob.@ExtensibleAttributes = anyAttributeArray;
890
891                         Reader.MoveToElement ();
892                         Reader.MoveToElement();
893                         if (Reader.IsEmptyElement) {
894                                 Reader.Skip ();
895                                 return ob;
896                         }
897
898                         Reader.ReadStartElement();
899                         Reader.MoveToContent();
900
901                         bool b40=false, b41=false, b42=false;
902
903                         System.Web.Services.Description.OperationFaultCollection o44;
904                         o44 = ob.@Faults;
905                         System.Web.Services.Description.OperationMessageCollection o46;
906                         o46 = ob.@Messages;
907                         int n43=0, n45=0;
908
909                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
910                         {
911                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
912                                 {
913                                         if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b42) {
914                                                 if (((object)o46) == null)
915                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
916                                                 o46.Add (ReadObject_OperationOutput (false, true));
917                                                 n45++;
918                                         }
919                                         else if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b42) {
920                                                 if (((object)o46) == null)
921                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
922                                                 o46.Add (ReadObject_OperationInput (false, true));
923                                                 n45++;
924                                         }
925                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b40) {
926                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
927                                         }
928                                         else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b41) {
929                                                 if (((object)o44) == null)
930                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationFaultCollection");
931                                                 o44.Add (ReadObject_OperationFault (false, true));
932                                                 n43++;
933                                         }
934                                         else {
935                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
936                                         }
937                                 }
938                                 else
939                                         UnknownNode(ob);
940
941                                 Reader.MoveToContent();
942                         }
943
944
945                         ReadEndElement();
946
947                         return ob;
948                 }
949
950                 public System.Web.Services.Description.OperationBinding ReadObject_OperationBinding (bool isNullable, bool checkType)
951                 {
952                         System.Web.Services.Description.OperationBinding ob = null;
953                         if (isNullable && ReadNull()) return null;
954
955                         if (checkType) 
956                         {
957                                 System.Xml.XmlQualifiedName t = GetXsiType();
958                                 if (t == null)
959                                 { }
960                                 else if (t.Name != "OperationBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
961                                         throw CreateUnknownTypeException(t);
962                         }
963
964                         ob = (System.Web.Services.Description.OperationBinding) Activator.CreateInstance(typeof(System.Web.Services.Description.OperationBinding), true);
965
966                         Reader.MoveToElement();
967
968                         int anyAttributeIndex = 0;
969                         System.Xml.XmlAttribute[] anyAttributeArray = null;
970                         while (Reader.MoveToNextAttribute())
971                         {
972                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
973                                         ob.@Name = Reader.Value;
974                                 }
975                                 else if (IsXmlnsAttribute (Reader.Name)) {
976                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
977                                         if (Reader.Prefix == "xmlns")
978                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
979                                         else
980                                                 ob.@Namespaces.Add ("", Reader.Value);
981                                 }
982                                 else {
983                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
984                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
985                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
986                                         anyAttributeIndex++;
987                                 }
988                         }
989
990                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
991                         ob.@ExtensibleAttributes = anyAttributeArray;
992
993                         Reader.MoveToElement ();
994                         Reader.MoveToElement();
995                         if (Reader.IsEmptyElement) {
996                                 Reader.Skip ();
997                                 return ob;
998                         }
999
1000                         Reader.ReadStartElement();
1001                         Reader.MoveToContent();
1002
1003                         bool b47=false, b48=false, b49=false, b50=false;
1004
1005                         System.Web.Services.Description.FaultBindingCollection o52;
1006                         o52 = ob.@Faults;
1007                         int n51=0;
1008
1009                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1010                         {
1011                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1012                                 {
1013                                         if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b49) {
1014                                                 b49 = true;
1015                                                 ob.@Input = ReadObject_InputBinding (false, true);
1016                                         }
1017                                         else if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b50) {
1018                                                 b50 = true;
1019                                                 ob.@Output = ReadObject_OutputBinding (false, true);
1020                                         }
1021                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b47) {
1022                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1023                                         }
1024                                         else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b48) {
1025                                                 if (((object)o52) == null)
1026                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.FaultBindingCollection");
1027                                                 o52.Add (ReadObject_FaultBinding (false, true));
1028                                                 n51++;
1029                                         }
1030                                         else {
1031                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1032                                         }
1033                                 }
1034                                 else
1035                                         UnknownNode(ob);
1036
1037                                 Reader.MoveToContent();
1038                         }
1039
1040
1041                         ReadEndElement();
1042
1043                         return ob;
1044                 }
1045
1046                 public System.Web.Services.Description.OperationOutput ReadObject_OperationOutput (bool isNullable, bool checkType)
1047                 {
1048                         System.Web.Services.Description.OperationOutput ob = null;
1049                         if (isNullable && ReadNull()) return null;
1050
1051                         if (checkType) 
1052                         {
1053                                 System.Xml.XmlQualifiedName t = GetXsiType();
1054                                 if (t == null)
1055                                 { }
1056                                 else if (t.Name != "OperationOutput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1057                                         throw CreateUnknownTypeException(t);
1058                         }
1059
1060                         ob = (System.Web.Services.Description.OperationOutput) Activator.CreateInstance(typeof(System.Web.Services.Description.OperationOutput), true);
1061
1062                         Reader.MoveToElement();
1063
1064                         int anyAttributeIndex = 0;
1065                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1066                         while (Reader.MoveToNextAttribute())
1067                         {
1068                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1069                                         ob.@Name = Reader.Value;
1070                                 }
1071                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1072                                         ob.@Message = ToXmlQualifiedName (Reader.Value);
1073                                 }
1074                                 else if (IsXmlnsAttribute (Reader.Name)) {
1075                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1076                                         if (Reader.Prefix == "xmlns")
1077                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1078                                         else
1079                                                 ob.@Namespaces.Add ("", Reader.Value);
1080                                 }
1081                                 else {
1082                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1083                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1084                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1085                                         anyAttributeIndex++;
1086                                 }
1087                         }
1088
1089                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1090                         ob.@ExtensibleAttributes = anyAttributeArray;
1091
1092                         Reader.MoveToElement ();
1093                         Reader.MoveToElement();
1094                         if (Reader.IsEmptyElement) {
1095                                 Reader.Skip ();
1096                                 return ob;
1097                         }
1098
1099                         Reader.ReadStartElement();
1100                         Reader.MoveToContent();
1101
1102                         bool b53=false;
1103
1104                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1105                         {
1106                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1107                                 {
1108                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b53) {
1109                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1110                                         }
1111                                         else {
1112                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1113                                         }
1114                                 }
1115                                 else
1116                                         UnknownNode(ob);
1117
1118                                 Reader.MoveToContent();
1119                         }
1120
1121                         ReadEndElement();
1122
1123                         return ob;
1124                 }
1125
1126                 public System.Web.Services.Description.OperationInput ReadObject_OperationInput (bool isNullable, bool checkType)
1127                 {
1128                         System.Web.Services.Description.OperationInput ob = null;
1129                         if (isNullable && ReadNull()) return null;
1130
1131                         if (checkType) 
1132                         {
1133                                 System.Xml.XmlQualifiedName t = GetXsiType();
1134                                 if (t == null)
1135                                 { }
1136                                 else if (t.Name != "OperationInput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1137                                         throw CreateUnknownTypeException(t);
1138                         }
1139
1140                         ob = (System.Web.Services.Description.OperationInput) Activator.CreateInstance(typeof(System.Web.Services.Description.OperationInput), true);
1141
1142                         Reader.MoveToElement();
1143
1144                         int anyAttributeIndex = 0;
1145                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1146                         while (Reader.MoveToNextAttribute())
1147                         {
1148                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1149                                         ob.@Name = Reader.Value;
1150                                 }
1151                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1152                                         ob.@Message = ToXmlQualifiedName (Reader.Value);
1153                                 }
1154                                 else if (IsXmlnsAttribute (Reader.Name)) {
1155                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1156                                         if (Reader.Prefix == "xmlns")
1157                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1158                                         else
1159                                                 ob.@Namespaces.Add ("", Reader.Value);
1160                                 }
1161                                 else {
1162                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1163                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1164                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1165                                         anyAttributeIndex++;
1166                                 }
1167                         }
1168
1169                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1170                         ob.@ExtensibleAttributes = anyAttributeArray;
1171
1172                         Reader.MoveToElement ();
1173                         Reader.MoveToElement();
1174                         if (Reader.IsEmptyElement) {
1175                                 Reader.Skip ();
1176                                 return ob;
1177                         }
1178
1179                         Reader.ReadStartElement();
1180                         Reader.MoveToContent();
1181
1182                         bool b54=false;
1183
1184                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1185                         {
1186                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1187                                 {
1188                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b54) {
1189                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1190                                         }
1191                                         else {
1192                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1193                                         }
1194                                 }
1195                                 else
1196                                         UnknownNode(ob);
1197
1198                                 Reader.MoveToContent();
1199                         }
1200
1201                         ReadEndElement();
1202
1203                         return ob;
1204                 }
1205
1206                 public System.Web.Services.Description.OperationFault ReadObject_OperationFault (bool isNullable, bool checkType)
1207                 {
1208                         System.Web.Services.Description.OperationFault ob = null;
1209                         if (isNullable && ReadNull()) return null;
1210
1211                         if (checkType) 
1212                         {
1213                                 System.Xml.XmlQualifiedName t = GetXsiType();
1214                                 if (t == null)
1215                                 { }
1216                                 else if (t.Name != "OperationFault" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1217                                         throw CreateUnknownTypeException(t);
1218                         }
1219
1220                         ob = (System.Web.Services.Description.OperationFault) Activator.CreateInstance(typeof(System.Web.Services.Description.OperationFault), true);
1221
1222                         Reader.MoveToElement();
1223
1224                         int anyAttributeIndex = 0;
1225                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1226                         while (Reader.MoveToNextAttribute())
1227                         {
1228                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1229                                         ob.@Name = Reader.Value;
1230                                 }
1231                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1232                                         ob.@Message = ToXmlQualifiedName (Reader.Value);
1233                                 }
1234                                 else if (IsXmlnsAttribute (Reader.Name)) {
1235                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1236                                         if (Reader.Prefix == "xmlns")
1237                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1238                                         else
1239                                                 ob.@Namespaces.Add ("", Reader.Value);
1240                                 }
1241                                 else {
1242                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1243                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1244                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1245                                         anyAttributeIndex++;
1246                                 }
1247                         }
1248
1249                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1250                         ob.@ExtensibleAttributes = anyAttributeArray;
1251
1252                         Reader.MoveToElement ();
1253                         Reader.MoveToElement();
1254                         if (Reader.IsEmptyElement) {
1255                                 Reader.Skip ();
1256                                 return ob;
1257                         }
1258
1259                         Reader.ReadStartElement();
1260                         Reader.MoveToContent();
1261
1262                         bool b55=false;
1263
1264                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1265                         {
1266                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1267                                 {
1268                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b55) {
1269                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1270                                         }
1271                                         else {
1272                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1273                                         }
1274                                 }
1275                                 else
1276                                         UnknownNode(ob);
1277
1278                                 Reader.MoveToContent();
1279                         }
1280
1281                         ReadEndElement();
1282
1283                         return ob;
1284                 }
1285
1286                 public System.Web.Services.Description.InputBinding ReadObject_InputBinding (bool isNullable, bool checkType)
1287                 {
1288                         System.Web.Services.Description.InputBinding ob = null;
1289                         if (isNullable && ReadNull()) return null;
1290
1291                         if (checkType) 
1292                         {
1293                                 System.Xml.XmlQualifiedName t = GetXsiType();
1294                                 if (t == null)
1295                                 { }
1296                                 else if (t.Name != "InputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1297                                         throw CreateUnknownTypeException(t);
1298                         }
1299
1300                         ob = (System.Web.Services.Description.InputBinding) Activator.CreateInstance(typeof(System.Web.Services.Description.InputBinding), true);
1301
1302                         Reader.MoveToElement();
1303
1304                         int anyAttributeIndex = 0;
1305                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1306                         while (Reader.MoveToNextAttribute())
1307                         {
1308                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1309                                         ob.@Name = Reader.Value;
1310                                 }
1311                                 else if (IsXmlnsAttribute (Reader.Name)) {
1312                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1313                                         if (Reader.Prefix == "xmlns")
1314                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1315                                         else
1316                                                 ob.@Namespaces.Add ("", Reader.Value);
1317                                 }
1318                                 else {
1319                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1320                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1321                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1322                                         anyAttributeIndex++;
1323                                 }
1324                         }
1325
1326                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1327                         ob.@ExtensibleAttributes = anyAttributeArray;
1328
1329                         Reader.MoveToElement ();
1330                         Reader.MoveToElement();
1331                         if (Reader.IsEmptyElement) {
1332                                 Reader.Skip ();
1333                                 return ob;
1334                         }
1335
1336                         Reader.ReadStartElement();
1337                         Reader.MoveToContent();
1338
1339                         bool b56=false;
1340
1341                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1342                         {
1343                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1344                                 {
1345                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b56) {
1346                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1347                                         }
1348                                         else {
1349                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1350                                         }
1351                                 }
1352                                 else
1353                                         UnknownNode(ob);
1354
1355                                 Reader.MoveToContent();
1356                         }
1357
1358                         ReadEndElement();
1359
1360                         return ob;
1361                 }
1362
1363                 public System.Web.Services.Description.OutputBinding ReadObject_OutputBinding (bool isNullable, bool checkType)
1364                 {
1365                         System.Web.Services.Description.OutputBinding ob = null;
1366                         if (isNullable && ReadNull()) return null;
1367
1368                         if (checkType) 
1369                         {
1370                                 System.Xml.XmlQualifiedName t = GetXsiType();
1371                                 if (t == null)
1372                                 { }
1373                                 else if (t.Name != "OutputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1374                                         throw CreateUnknownTypeException(t);
1375                         }
1376
1377                         ob = (System.Web.Services.Description.OutputBinding) Activator.CreateInstance(typeof(System.Web.Services.Description.OutputBinding), true);
1378
1379                         Reader.MoveToElement();
1380
1381                         int anyAttributeIndex = 0;
1382                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1383                         while (Reader.MoveToNextAttribute())
1384                         {
1385                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1386                                         ob.@Name = Reader.Value;
1387                                 }
1388                                 else if (IsXmlnsAttribute (Reader.Name)) {
1389                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1390                                         if (Reader.Prefix == "xmlns")
1391                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1392                                         else
1393                                                 ob.@Namespaces.Add ("", Reader.Value);
1394                                 }
1395                                 else {
1396                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1397                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1398                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1399                                         anyAttributeIndex++;
1400                                 }
1401                         }
1402
1403                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1404                         ob.@ExtensibleAttributes = anyAttributeArray;
1405
1406                         Reader.MoveToElement ();
1407                         Reader.MoveToElement();
1408                         if (Reader.IsEmptyElement) {
1409                                 Reader.Skip ();
1410                                 return ob;
1411                         }
1412
1413                         Reader.ReadStartElement();
1414                         Reader.MoveToContent();
1415
1416                         bool b57=false;
1417
1418                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1419                         {
1420                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1421                                 {
1422                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b57) {
1423                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1424                                         }
1425                                         else {
1426                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1427                                         }
1428                                 }
1429                                 else
1430                                         UnknownNode(ob);
1431
1432                                 Reader.MoveToContent();
1433                         }
1434
1435                         ReadEndElement();
1436
1437                         return ob;
1438                 }
1439
1440                 public System.Web.Services.Description.FaultBinding ReadObject_FaultBinding (bool isNullable, bool checkType)
1441                 {
1442                         System.Web.Services.Description.FaultBinding ob = null;
1443                         if (isNullable && ReadNull()) return null;
1444
1445                         if (checkType) 
1446                         {
1447                                 System.Xml.XmlQualifiedName t = GetXsiType();
1448                                 if (t == null)
1449                                 { }
1450                                 else if (t.Name != "FaultBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1451                                         throw CreateUnknownTypeException(t);
1452                         }
1453
1454                         ob = (System.Web.Services.Description.FaultBinding) Activator.CreateInstance(typeof(System.Web.Services.Description.FaultBinding), true);
1455
1456                         Reader.MoveToElement();
1457
1458                         int anyAttributeIndex = 0;
1459                         System.Xml.XmlAttribute[] anyAttributeArray = null;
1460                         while (Reader.MoveToNextAttribute())
1461                         {
1462                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1463                                         ob.@Name = Reader.Value;
1464                                 }
1465                                 else if (IsXmlnsAttribute (Reader.Name)) {
1466                                         if (ob.@Namespaces == null) ob.@Namespaces = new XmlSerializerNamespaces ();
1467                                         if (Reader.Prefix == "xmlns")
1468                                                 ob.@Namespaces.Add (Reader.LocalName, Reader.Value);
1469                                         else
1470                                                 ob.@Namespaces.Add ("", Reader.Value);
1471                                 }
1472                                 else {
1473                                         System.Xml.XmlAttribute attr = (System.Xml.XmlAttribute) Document.ReadNode(Reader);
1474                                         anyAttributeArray = (System.Xml.XmlAttribute[]) EnsureArrayIndex (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute));
1475                                         anyAttributeArray[anyAttributeIndex] = ((System.Xml.XmlAttribute) attr);
1476                                         anyAttributeIndex++;
1477                                 }
1478                         }
1479
1480                         anyAttributeArray = (System.Xml.XmlAttribute[]) ShrinkArray (anyAttributeArray, anyAttributeIndex, typeof(System.Xml.XmlAttribute), true);
1481                         ob.@ExtensibleAttributes = anyAttributeArray;
1482
1483                         Reader.MoveToElement ();
1484                         Reader.MoveToElement();
1485                         if (Reader.IsEmptyElement) {
1486                                 Reader.Skip ();
1487                                 return ob;
1488                         }
1489
1490                         Reader.ReadStartElement();
1491                         Reader.MoveToContent();
1492
1493                         bool b58=false;
1494
1495                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1496                         {
1497                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1498                                 {
1499                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b58) {
1500                                                 ob.@DocumentationElement = ((System.Xml.XmlElement) ReadXmlNode (false));
1501                                         }
1502                                         else {
1503                                                 ServiceDescription.ReadExtension (Document, Reader, ob);
1504                                         }
1505                                 }
1506                                 else
1507                                         UnknownNode(ob);
1508
1509                                 Reader.MoveToContent();
1510                         }
1511
1512                         ReadEndElement();
1513
1514                         return ob;
1515                 }
1516
1517                 protected override void InitCallbacks ()
1518                 {
1519                 }
1520
1521                 protected override void InitIDs ()
1522                 {
1523                 }
1524
1525         }
1526
1527         internal class ServiceDescriptionWriterBase : XmlSerializationWriter
1528         {
1529                 const string xmlNamespace = "http://www.w3.org/2000/xmlns/";
1530                 static readonly System.Reflection.MethodInfo toBinHexStringMethod = typeof (XmlConvert).GetMethod ("ToBinHexString", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic, null, new Type [] {typeof (byte [])}, null);
1531                 static string ToBinHexString (byte [] input)
1532                 {
1533                         return input == null ? null : (string) toBinHexStringMethod.Invoke (null, new object [] {input});
1534                 }
1535                 public void WriteRoot_ServiceDescription (object o)
1536                 {
1537                         WriteStartDocument ();
1538                         System.Web.Services.Description.ServiceDescription ob = (System.Web.Services.Description.ServiceDescription) o;
1539                         TopLevelElement ();
1540                         WriteObject_ServiceDescription (ob, "definitions", "http://schemas.xmlsoap.org/wsdl/", true, false, true);
1541                 }
1542
1543                 void WriteObject_ServiceDescription (System.Web.Services.Description.ServiceDescription ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1544                 {
1545                         if (((object)ob) == null)
1546                         {
1547                                 if (isNullable)
1548                                         WriteNullTagLiteral(element, namesp);
1549                                 return;
1550                         }
1551
1552                         System.Type type = ob.GetType ();
1553                         if (type == typeof(System.Web.Services.Description.ServiceDescription))
1554                         { }
1555                         else {
1556                                 throw CreateUnknownTypeException (ob);
1557                         }
1558
1559                         if (writeWrappingElem) {
1560                                 WriteStartElement (element, namesp, ob);
1561                         }
1562
1563                         if (needType) WriteXsiType("ServiceDescription", "http://schemas.xmlsoap.org/wsdl/");
1564
1565                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1566
1567                         ICollection o59 = ob.@ExtensibleAttributes;
1568                         if (o59 != null) {
1569                                 foreach (XmlAttribute o60 in o59)
1570                                         if (o60.NamespaceURI != xmlNamespace)
1571                                                 WriteXmlAttribute (o60, ob);
1572                         }
1573
1574                         WriteAttribute ("name", "", ob.@Name);
1575                         WriteAttribute ("targetNamespace", "", ob.@TargetNamespace);
1576
1577                         ServiceDescription.WriteExtensions (Writer, ob);
1578                         if (ob.@DocumentationElement != null) {
1579                                 XmlNode o61 = ob.@DocumentationElement;
1580                                 if (o61 is XmlElement) {
1581                                 if ((o61.LocalName == "documentation" && o61.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1582                                         }
1583                                         else o61.WriteTo (Writer);
1584                                         WriteElementLiteral (o61, "", "", false, true);
1585                                 }
1586                                 else
1587                                         throw CreateUnknownAnyElementException (o61.Name, o61.NamespaceURI);
1588                         }
1589                         if (ob.@Imports != null) {
1590                                 for (int n62 = 0; n62 < ob.@Imports.Count; n62++) {
1591                                         WriteObject_Import (ob.@Imports[n62], "import", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1592                                 }
1593                         }
1594                         WriteObject_Types (ob.@Types, "types", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1595                         if (ob.@Messages != null) {
1596                                 for (int n63 = 0; n63 < ob.@Messages.Count; n63++) {
1597                                         WriteObject_Message (ob.@Messages[n63], "message", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1598                                 }
1599                         }
1600                         if (ob.@PortTypes != null) {
1601                                 for (int n64 = 0; n64 < ob.@PortTypes.Count; n64++) {
1602                                         WriteObject_PortType (ob.@PortTypes[n64], "portType", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1603                                 }
1604                         }
1605                         if (ob.@Bindings != null) {
1606                                 for (int n65 = 0; n65 < ob.@Bindings.Count; n65++) {
1607                                         WriteObject_Binding (ob.@Bindings[n65], "binding", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1608                                 }
1609                         }
1610                         if (ob.@Services != null) {
1611                                 for (int n66 = 0; n66 < ob.@Services.Count; n66++) {
1612                                         WriteObject_Service (ob.@Services[n66], "service", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1613                                 }
1614                         }
1615                         if (writeWrappingElem) WriteEndElement (ob);
1616                 }
1617
1618                 void WriteObject_Import (System.Web.Services.Description.Import ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1619                 {
1620                         if (((object)ob) == null)
1621                         {
1622                                 if (isNullable)
1623                                         WriteNullTagLiteral(element, namesp);
1624                                 return;
1625                         }
1626
1627                         System.Type type = ob.GetType ();
1628                         if (type == typeof(System.Web.Services.Description.Import))
1629                         { }
1630                         else {
1631                                 throw CreateUnknownTypeException (ob);
1632                         }
1633
1634                         if (writeWrappingElem) {
1635                                 WriteStartElement (element, namesp, ob);
1636                         }
1637
1638                         if (needType) WriteXsiType("Import", "http://schemas.xmlsoap.org/wsdl/");
1639
1640                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1641
1642                         ICollection o67 = ob.@ExtensibleAttributes;
1643                         if (o67 != null) {
1644                                 foreach (XmlAttribute o68 in o67)
1645                                         if (o68.NamespaceURI != xmlNamespace)
1646                                                 WriteXmlAttribute (o68, ob);
1647                         }
1648
1649                         WriteAttribute ("location", "", ob.@Location);
1650                         WriteAttribute ("namespace", "", ob.@Namespace);
1651
1652                         ServiceDescription.WriteExtensions (Writer, ob);
1653                         if (ob.@DocumentationElement != null) {
1654                                 XmlNode o69 = ob.@DocumentationElement;
1655                                 if (o69 is XmlElement) {
1656                                 if ((o69.LocalName == "documentation" && o69.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1657                                         }
1658                                         else o69.WriteTo (Writer);
1659                                         WriteElementLiteral (o69, "", "", false, true);
1660                                 }
1661                                 else
1662                                         throw CreateUnknownAnyElementException (o69.Name, o69.NamespaceURI);
1663                         }
1664                         if (writeWrappingElem) WriteEndElement (ob);
1665                 }
1666
1667                 void WriteObject_Types (System.Web.Services.Description.Types ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1668                 {
1669                         if (((object)ob) == null)
1670                         {
1671                                 if (isNullable)
1672                                         WriteNullTagLiteral(element, namesp);
1673                                 return;
1674                         }
1675
1676                         System.Type type = ob.GetType ();
1677                         if (type == typeof(System.Web.Services.Description.Types))
1678                         { }
1679                         else {
1680                                 throw CreateUnknownTypeException (ob);
1681                         }
1682
1683                         if (writeWrappingElem) {
1684                                 WriteStartElement (element, namesp, ob);
1685                         }
1686
1687                         if (needType) WriteXsiType("Types", "http://schemas.xmlsoap.org/wsdl/");
1688
1689                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1690
1691                         ICollection o70 = ob.@ExtensibleAttributes;
1692                         if (o70 != null) {
1693                                 foreach (XmlAttribute o71 in o70)
1694                                         if (o71.NamespaceURI != xmlNamespace)
1695                                                 WriteXmlAttribute (o71, ob);
1696                         }
1697
1698                         ServiceDescription.WriteExtensions (Writer, ob);
1699                         if (ob.@DocumentationElement != null) {
1700                                 XmlNode o72 = ob.@DocumentationElement;
1701                                 if (o72 is XmlElement) {
1702                                 if ((o72.LocalName == "documentation" && o72.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1703                                         }
1704                                         else o72.WriteTo (Writer);
1705                                         WriteElementLiteral (o72, "", "", false, true);
1706                                 }
1707                                 else
1708                                         throw CreateUnknownAnyElementException (o72.Name, o72.NamespaceURI);
1709                         }
1710                         if (ob.@Schemas != null) {
1711                                 for (int n73 = 0; n73 < ob.@Schemas.Count; n73++) {
1712                                         WriteObject_XmlSchema (ob.@Schemas[n73], "schema", "http://www.w3.org/2001/XMLSchema", false, false, true);
1713                                 }
1714                         }
1715                         if (writeWrappingElem) WriteEndElement (ob);
1716                 }
1717
1718                 void WriteObject_Message (System.Web.Services.Description.Message ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1719                 {
1720                         if (((object)ob) == null)
1721                         {
1722                                 if (isNullable)
1723                                         WriteNullTagLiteral(element, namesp);
1724                                 return;
1725                         }
1726
1727                         System.Type type = ob.GetType ();
1728                         if (type == typeof(System.Web.Services.Description.Message))
1729                         { }
1730                         else {
1731                                 throw CreateUnknownTypeException (ob);
1732                         }
1733
1734                         if (writeWrappingElem) {
1735                                 WriteStartElement (element, namesp, ob);
1736                         }
1737
1738                         if (needType) WriteXsiType("Message", "http://schemas.xmlsoap.org/wsdl/");
1739
1740                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1741
1742                         ICollection o74 = ob.@ExtensibleAttributes;
1743                         if (o74 != null) {
1744                                 foreach (XmlAttribute o75 in o74)
1745                                         if (o75.NamespaceURI != xmlNamespace)
1746                                                 WriteXmlAttribute (o75, ob);
1747                         }
1748
1749                         WriteAttribute ("name", "", ob.@Name);
1750
1751                         ServiceDescription.WriteExtensions (Writer, ob);
1752                         if (ob.@DocumentationElement != null) {
1753                                 XmlNode o76 = ob.@DocumentationElement;
1754                                 if (o76 is XmlElement) {
1755                                 if ((o76.LocalName == "documentation" && o76.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1756                                         }
1757                                         else o76.WriteTo (Writer);
1758                                         WriteElementLiteral (o76, "", "", false, true);
1759                                 }
1760                                 else
1761                                         throw CreateUnknownAnyElementException (o76.Name, o76.NamespaceURI);
1762                         }
1763                         if (ob.@Parts != null) {
1764                                 for (int n77 = 0; n77 < ob.@Parts.Count; n77++) {
1765                                         WriteObject_MessagePart (ob.@Parts[n77], "part", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1766                                 }
1767                         }
1768                         if (writeWrappingElem) WriteEndElement (ob);
1769                 }
1770
1771                 void WriteObject_PortType (System.Web.Services.Description.PortType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1772                 {
1773                         if (((object)ob) == null)
1774                         {
1775                                 if (isNullable)
1776                                         WriteNullTagLiteral(element, namesp);
1777                                 return;
1778                         }
1779
1780                         System.Type type = ob.GetType ();
1781                         if (type == typeof(System.Web.Services.Description.PortType))
1782                         { }
1783                         else {
1784                                 throw CreateUnknownTypeException (ob);
1785                         }
1786
1787                         if (writeWrappingElem) {
1788                                 WriteStartElement (element, namesp, ob);
1789                         }
1790
1791                         if (needType) WriteXsiType("PortType", "http://schemas.xmlsoap.org/wsdl/");
1792
1793                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1794
1795                         ICollection o78 = ob.@ExtensibleAttributes;
1796                         if (o78 != null) {
1797                                 foreach (XmlAttribute o79 in o78)
1798                                         if (o79.NamespaceURI != xmlNamespace)
1799                                                 WriteXmlAttribute (o79, ob);
1800                         }
1801
1802                         WriteAttribute ("name", "", ob.@Name);
1803
1804                         ServiceDescription.WriteExtensions (Writer, ob);
1805                         if (ob.@DocumentationElement != null) {
1806                                 XmlNode o80 = ob.@DocumentationElement;
1807                                 if (o80 is XmlElement) {
1808                                 if ((o80.LocalName == "documentation" && o80.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1809                                         }
1810                                         else o80.WriteTo (Writer);
1811                                         WriteElementLiteral (o80, "", "", false, true);
1812                                 }
1813                                 else
1814                                         throw CreateUnknownAnyElementException (o80.Name, o80.NamespaceURI);
1815                         }
1816                         if (ob.@Operations != null) {
1817                                 for (int n81 = 0; n81 < ob.@Operations.Count; n81++) {
1818                                         WriteObject_Operation (ob.@Operations[n81], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1819                                 }
1820                         }
1821                         if (writeWrappingElem) WriteEndElement (ob);
1822                 }
1823
1824                 void WriteObject_Binding (System.Web.Services.Description.Binding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1825                 {
1826                         if (((object)ob) == null)
1827                         {
1828                                 if (isNullable)
1829                                         WriteNullTagLiteral(element, namesp);
1830                                 return;
1831                         }
1832
1833                         System.Type type = ob.GetType ();
1834                         if (type == typeof(System.Web.Services.Description.Binding))
1835                         { }
1836                         else {
1837                                 throw CreateUnknownTypeException (ob);
1838                         }
1839
1840                         if (writeWrappingElem) {
1841                                 WriteStartElement (element, namesp, ob);
1842                         }
1843
1844                         if (needType) WriteXsiType("Binding", "http://schemas.xmlsoap.org/wsdl/");
1845
1846                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1847
1848                         ICollection o82 = ob.@ExtensibleAttributes;
1849                         if (o82 != null) {
1850                                 foreach (XmlAttribute o83 in o82)
1851                                         if (o83.NamespaceURI != xmlNamespace)
1852                                                 WriteXmlAttribute (o83, ob);
1853                         }
1854
1855                         WriteAttribute ("name", "", ob.@Name);
1856                         WriteAttribute ("type", "", FromXmlQualifiedName (ob.@Type));
1857
1858                         ServiceDescription.WriteExtensions (Writer, ob);
1859                         if (ob.@DocumentationElement != null) {
1860                                 XmlNode o84 = ob.@DocumentationElement;
1861                                 if (o84 is XmlElement) {
1862                                 if ((o84.LocalName == "documentation" && o84.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1863                                         }
1864                                         else o84.WriteTo (Writer);
1865                                         WriteElementLiteral (o84, "", "", false, true);
1866                                 }
1867                                 else
1868                                         throw CreateUnknownAnyElementException (o84.Name, o84.NamespaceURI);
1869                         }
1870                         if (ob.@Operations != null) {
1871                                 for (int n85 = 0; n85 < ob.@Operations.Count; n85++) {
1872                                         WriteObject_OperationBinding (ob.@Operations[n85], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1873                                 }
1874                         }
1875                         if (writeWrappingElem) WriteEndElement (ob);
1876                 }
1877
1878                 void WriteObject_Service (System.Web.Services.Description.Service ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1879                 {
1880                         if (((object)ob) == null)
1881                         {
1882                                 if (isNullable)
1883                                         WriteNullTagLiteral(element, namesp);
1884                                 return;
1885                         }
1886
1887                         System.Type type = ob.GetType ();
1888                         if (type == typeof(System.Web.Services.Description.Service))
1889                         { }
1890                         else {
1891                                 throw CreateUnknownTypeException (ob);
1892                         }
1893
1894                         if (writeWrappingElem) {
1895                                 WriteStartElement (element, namesp, ob);
1896                         }
1897
1898                         if (needType) WriteXsiType("Service", "http://schemas.xmlsoap.org/wsdl/");
1899
1900                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1901
1902                         ICollection o86 = ob.@ExtensibleAttributes;
1903                         if (o86 != null) {
1904                                 foreach (XmlAttribute o87 in o86)
1905                                         if (o87.NamespaceURI != xmlNamespace)
1906                                                 WriteXmlAttribute (o87, ob);
1907                         }
1908
1909                         WriteAttribute ("name", "", ob.@Name);
1910
1911                         ServiceDescription.WriteExtensions (Writer, ob);
1912                         if (ob.@DocumentationElement != null) {
1913                                 XmlNode o88 = ob.@DocumentationElement;
1914                                 if (o88 is XmlElement) {
1915                                 if ((o88.LocalName == "documentation" && o88.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1916                                         }
1917                                         else o88.WriteTo (Writer);
1918                                         WriteElementLiteral (o88, "", "", false, true);
1919                                 }
1920                                 else
1921                                         throw CreateUnknownAnyElementException (o88.Name, o88.NamespaceURI);
1922                         }
1923                         if (ob.@Ports != null) {
1924                                 for (int n89 = 0; n89 < ob.@Ports.Count; n89++) {
1925                                         WriteObject_Port (ob.@Ports[n89], "port", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1926                                 }
1927                         }
1928                         if (writeWrappingElem) WriteEndElement (ob);
1929                 }
1930
1931                 void WriteObject_XmlSchema (System.Xml.Schema.XmlSchema ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1932                 {
1933                         ob.Write (Writer);
1934                 }
1935
1936                 void WriteObject_MessagePart (System.Web.Services.Description.MessagePart ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1937                 {
1938                         if (((object)ob) == null)
1939                         {
1940                                 if (isNullable)
1941                                         WriteNullTagLiteral(element, namesp);
1942                                 return;
1943                         }
1944
1945                         System.Type type = ob.GetType ();
1946                         if (type == typeof(System.Web.Services.Description.MessagePart))
1947                         { }
1948                         else {
1949                                 throw CreateUnknownTypeException (ob);
1950                         }
1951
1952                         if (writeWrappingElem) {
1953                                 WriteStartElement (element, namesp, ob);
1954                         }
1955
1956                         if (needType) WriteXsiType("MessagePart", "http://schemas.xmlsoap.org/wsdl/");
1957
1958                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
1959
1960                         ICollection o90 = ob.@ExtensibleAttributes;
1961                         if (o90 != null) {
1962                                 foreach (XmlAttribute o91 in o90)
1963                                         if (o91.NamespaceURI != xmlNamespace)
1964                                                 WriteXmlAttribute (o91, ob);
1965                         }
1966
1967                         WriteAttribute ("name", "", ob.@Name);
1968                         WriteAttribute ("element", "", FromXmlQualifiedName (ob.@Element));
1969                         WriteAttribute ("type", "", FromXmlQualifiedName (ob.@Type));
1970
1971                         ServiceDescription.WriteExtensions (Writer, ob);
1972                         if (ob.@DocumentationElement != null) {
1973                                 XmlNode o92 = ob.@DocumentationElement;
1974                                 if (o92 is XmlElement) {
1975                                 if ((o92.LocalName == "documentation" && o92.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
1976                                         }
1977                                         else o92.WriteTo (Writer);
1978                                         WriteElementLiteral (o92, "", "", false, true);
1979                                 }
1980                                 else
1981                                         throw CreateUnknownAnyElementException (o92.Name, o92.NamespaceURI);
1982                         }
1983                         if (writeWrappingElem) WriteEndElement (ob);
1984                 }
1985
1986                 void WriteObject_Operation (System.Web.Services.Description.Operation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1987                 {
1988                         if (((object)ob) == null)
1989                         {
1990                                 if (isNullable)
1991                                         WriteNullTagLiteral(element, namesp);
1992                                 return;
1993                         }
1994
1995                         System.Type type = ob.GetType ();
1996                         if (type == typeof(System.Web.Services.Description.Operation))
1997                         { }
1998                         else {
1999                                 throw CreateUnknownTypeException (ob);
2000                         }
2001
2002                         if (writeWrappingElem) {
2003                                 WriteStartElement (element, namesp, ob);
2004                         }
2005
2006                         if (needType) WriteXsiType("Operation", "http://schemas.xmlsoap.org/wsdl/");
2007
2008                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2009
2010                         ICollection o93 = ob.@ExtensibleAttributes;
2011                         if (o93 != null) {
2012                                 foreach (XmlAttribute o94 in o93)
2013                                         if (o94.NamespaceURI != xmlNamespace)
2014                                                 WriteXmlAttribute (o94, ob);
2015                         }
2016
2017                         WriteAttribute ("name", "", ob.@Name);
2018                         if (ob.@ParameterOrderString != "") {
2019                                 WriteAttribute ("parameterOrder", "", ob.@ParameterOrderString);
2020                         }
2021
2022                         ServiceDescription.WriteExtensions (Writer, ob);
2023                         if (ob.@DocumentationElement != null) {
2024                                 XmlNode o95 = ob.@DocumentationElement;
2025                                 if (o95 is XmlElement) {
2026                                 if ((o95.LocalName == "documentation" && o95.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2027                                         }
2028                                         else o95.WriteTo (Writer);
2029                                         WriteElementLiteral (o95, "", "", false, true);
2030                                 }
2031                                 else
2032                                         throw CreateUnknownAnyElementException (o95.Name, o95.NamespaceURI);
2033                         }
2034                         if (ob.@Faults != null) {
2035                                 for (int n96 = 0; n96 < ob.@Faults.Count; n96++) {
2036                                         WriteObject_OperationFault (ob.@Faults[n96], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2037                                 }
2038                         }
2039                         if (ob.@Messages != null) {
2040                                 for (int n97 = 0; n97 < ob.@Messages.Count; n97++) {
2041                                         if (((object)ob.@Messages[n97]) == null) { }
2042                                         else if (ob.@Messages[n97].GetType() == typeof(System.Web.Services.Description.OperationOutput)) {
2043                                                 WriteObject_OperationOutput (((System.Web.Services.Description.OperationOutput) ob.@Messages[n97]), "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2044                                         }
2045                                         else if (ob.@Messages[n97].GetType() == typeof(System.Web.Services.Description.OperationInput)) {
2046                                                 WriteObject_OperationInput (((System.Web.Services.Description.OperationInput) ob.@Messages[n97]), "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2047                                         }
2048                                         else throw CreateUnknownTypeException (ob.@Messages[n97]);
2049                                 }
2050                         }
2051                         if (writeWrappingElem) WriteEndElement (ob);
2052                 }
2053
2054                 void WriteObject_OperationBinding (System.Web.Services.Description.OperationBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2055                 {
2056                         if (((object)ob) == null)
2057                         {
2058                                 if (isNullable)
2059                                         WriteNullTagLiteral(element, namesp);
2060                                 return;
2061                         }
2062
2063                         System.Type type = ob.GetType ();
2064                         if (type == typeof(System.Web.Services.Description.OperationBinding))
2065                         { }
2066                         else {
2067                                 throw CreateUnknownTypeException (ob);
2068                         }
2069
2070                         if (writeWrappingElem) {
2071                                 WriteStartElement (element, namesp, ob);
2072                         }
2073
2074                         if (needType) WriteXsiType("OperationBinding", "http://schemas.xmlsoap.org/wsdl/");
2075
2076                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2077
2078                         ICollection o98 = ob.@ExtensibleAttributes;
2079                         if (o98 != null) {
2080                                 foreach (XmlAttribute o99 in o98)
2081                                         if (o99.NamespaceURI != xmlNamespace)
2082                                                 WriteXmlAttribute (o99, ob);
2083                         }
2084
2085                         WriteAttribute ("name", "", ob.@Name);
2086
2087                         ServiceDescription.WriteExtensions (Writer, ob);
2088                         if (ob.@DocumentationElement != null) {
2089                                 XmlNode o100 = ob.@DocumentationElement;
2090                                 if (o100 is XmlElement) {
2091                                 if ((o100.LocalName == "documentation" && o100.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2092                                         }
2093                                         else o100.WriteTo (Writer);
2094                                         WriteElementLiteral (o100, "", "", false, true);
2095                                 }
2096                                 else
2097                                         throw CreateUnknownAnyElementException (o100.Name, o100.NamespaceURI);
2098                         }
2099                         if (ob.@Faults != null) {
2100                                 for (int n101 = 0; n101 < ob.@Faults.Count; n101++) {
2101                                         WriteObject_FaultBinding (ob.@Faults[n101], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2102                                 }
2103                         }
2104                         WriteObject_InputBinding (ob.@Input, "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2105                         WriteObject_OutputBinding (ob.@Output, "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
2106                         if (writeWrappingElem) WriteEndElement (ob);
2107                 }
2108
2109                 void WriteObject_Port (System.Web.Services.Description.Port ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2110                 {
2111                         if (((object)ob) == null)
2112                         {
2113                                 if (isNullable)
2114                                         WriteNullTagLiteral(element, namesp);
2115                                 return;
2116                         }
2117
2118                         System.Type type = ob.GetType ();
2119                         if (type == typeof(System.Web.Services.Description.Port))
2120                         { }
2121                         else {
2122                                 throw CreateUnknownTypeException (ob);
2123                         }
2124
2125                         if (writeWrappingElem) {
2126                                 WriteStartElement (element, namesp, ob);
2127                         }
2128
2129                         if (needType) WriteXsiType("Port", "http://schemas.xmlsoap.org/wsdl/");
2130
2131                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2132
2133                         ICollection o102 = ob.@ExtensibleAttributes;
2134                         if (o102 != null) {
2135                                 foreach (XmlAttribute o103 in o102)
2136                                         if (o103.NamespaceURI != xmlNamespace)
2137                                                 WriteXmlAttribute (o103, ob);
2138                         }
2139
2140                         WriteAttribute ("name", "", ob.@Name);
2141                         WriteAttribute ("binding", "", FromXmlQualifiedName (ob.@Binding));
2142
2143                         ServiceDescription.WriteExtensions (Writer, ob);
2144                         if (ob.@DocumentationElement != null) {
2145                                 XmlNode o104 = ob.@DocumentationElement;
2146                                 if (o104 is XmlElement) {
2147                                 if ((o104.LocalName == "documentation" && o104.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2148                                         }
2149                                         else o104.WriteTo (Writer);
2150                                         WriteElementLiteral (o104, "", "", false, true);
2151                                 }
2152                                 else
2153                                         throw CreateUnknownAnyElementException (o104.Name, o104.NamespaceURI);
2154                         }
2155                         if (writeWrappingElem) WriteEndElement (ob);
2156                 }
2157
2158                 void WriteObject_OperationFault (System.Web.Services.Description.OperationFault ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2159                 {
2160                         if (((object)ob) == null)
2161                         {
2162                                 if (isNullable)
2163                                         WriteNullTagLiteral(element, namesp);
2164                                 return;
2165                         }
2166
2167                         System.Type type = ob.GetType ();
2168                         if (type == typeof(System.Web.Services.Description.OperationFault))
2169                         { }
2170                         else {
2171                                 throw CreateUnknownTypeException (ob);
2172                         }
2173
2174                         if (writeWrappingElem) {
2175                                 WriteStartElement (element, namesp, ob);
2176                         }
2177
2178                         if (needType) WriteXsiType("OperationFault", "http://schemas.xmlsoap.org/wsdl/");
2179
2180                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2181
2182                         ICollection o105 = ob.@ExtensibleAttributes;
2183                         if (o105 != null) {
2184                                 foreach (XmlAttribute o106 in o105)
2185                                         if (o106.NamespaceURI != xmlNamespace)
2186                                                 WriteXmlAttribute (o106, ob);
2187                         }
2188
2189                         WriteAttribute ("name", "", ob.@Name);
2190                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
2191
2192                         ServiceDescription.WriteExtensions (Writer, ob);
2193                         if (ob.@DocumentationElement != null) {
2194                                 XmlNode o107 = ob.@DocumentationElement;
2195                                 if (o107 is XmlElement) {
2196                                 if ((o107.LocalName == "documentation" && o107.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2197                                         }
2198                                         else o107.WriteTo (Writer);
2199                                         WriteElementLiteral (o107, "", "", false, true);
2200                                 }
2201                                 else
2202                                         throw CreateUnknownAnyElementException (o107.Name, o107.NamespaceURI);
2203                         }
2204                         if (writeWrappingElem) WriteEndElement (ob);
2205                 }
2206
2207                 void WriteObject_OperationOutput (System.Web.Services.Description.OperationOutput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2208                 {
2209                         if (((object)ob) == null)
2210                         {
2211                                 if (isNullable)
2212                                         WriteNullTagLiteral(element, namesp);
2213                                 return;
2214                         }
2215
2216                         System.Type type = ob.GetType ();
2217                         if (type == typeof(System.Web.Services.Description.OperationOutput))
2218                         { }
2219                         else {
2220                                 throw CreateUnknownTypeException (ob);
2221                         }
2222
2223                         if (writeWrappingElem) {
2224                                 WriteStartElement (element, namesp, ob);
2225                         }
2226
2227                         if (needType) WriteXsiType("OperationOutput", "http://schemas.xmlsoap.org/wsdl/");
2228
2229                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2230
2231                         ICollection o108 = ob.@ExtensibleAttributes;
2232                         if (o108 != null) {
2233                                 foreach (XmlAttribute o109 in o108)
2234                                         if (o109.NamespaceURI != xmlNamespace)
2235                                                 WriteXmlAttribute (o109, ob);
2236                         }
2237
2238                         WriteAttribute ("name", "", ob.@Name);
2239                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
2240
2241                         ServiceDescription.WriteExtensions (Writer, ob);
2242                         if (ob.@DocumentationElement != null) {
2243                                 XmlNode o110 = ob.@DocumentationElement;
2244                                 if (o110 is XmlElement) {
2245                                 if ((o110.LocalName == "documentation" && o110.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2246                                         }
2247                                         else o110.WriteTo (Writer);
2248                                         WriteElementLiteral (o110, "", "", false, true);
2249                                 }
2250                                 else
2251                                         throw CreateUnknownAnyElementException (o110.Name, o110.NamespaceURI);
2252                         }
2253                         if (writeWrappingElem) WriteEndElement (ob);
2254                 }
2255
2256                 void WriteObject_OperationInput (System.Web.Services.Description.OperationInput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2257                 {
2258                         if (((object)ob) == null)
2259                         {
2260                                 if (isNullable)
2261                                         WriteNullTagLiteral(element, namesp);
2262                                 return;
2263                         }
2264
2265                         System.Type type = ob.GetType ();
2266                         if (type == typeof(System.Web.Services.Description.OperationInput))
2267                         { }
2268                         else {
2269                                 throw CreateUnknownTypeException (ob);
2270                         }
2271
2272                         if (writeWrappingElem) {
2273                                 WriteStartElement (element, namesp, ob);
2274                         }
2275
2276                         if (needType) WriteXsiType("OperationInput", "http://schemas.xmlsoap.org/wsdl/");
2277
2278                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2279
2280                         ICollection o111 = ob.@ExtensibleAttributes;
2281                         if (o111 != null) {
2282                                 foreach (XmlAttribute o112 in o111)
2283                                         if (o112.NamespaceURI != xmlNamespace)
2284                                                 WriteXmlAttribute (o112, ob);
2285                         }
2286
2287                         WriteAttribute ("name", "", ob.@Name);
2288                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.@Message));
2289
2290                         ServiceDescription.WriteExtensions (Writer, ob);
2291                         if (ob.@DocumentationElement != null) {
2292                                 XmlNode o113 = ob.@DocumentationElement;
2293                                 if (o113 is XmlElement) {
2294                                 if ((o113.LocalName == "documentation" && o113.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2295                                         }
2296                                         else o113.WriteTo (Writer);
2297                                         WriteElementLiteral (o113, "", "", false, true);
2298                                 }
2299                                 else
2300                                         throw CreateUnknownAnyElementException (o113.Name, o113.NamespaceURI);
2301                         }
2302                         if (writeWrappingElem) WriteEndElement (ob);
2303                 }
2304
2305                 void WriteObject_FaultBinding (System.Web.Services.Description.FaultBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2306                 {
2307                         if (((object)ob) == null)
2308                         {
2309                                 if (isNullable)
2310                                         WriteNullTagLiteral(element, namesp);
2311                                 return;
2312                         }
2313
2314                         System.Type type = ob.GetType ();
2315                         if (type == typeof(System.Web.Services.Description.FaultBinding))
2316                         { }
2317                         else {
2318                                 throw CreateUnknownTypeException (ob);
2319                         }
2320
2321                         if (writeWrappingElem) {
2322                                 WriteStartElement (element, namesp, ob);
2323                         }
2324
2325                         if (needType) WriteXsiType("FaultBinding", "http://schemas.xmlsoap.org/wsdl/");
2326
2327                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2328
2329                         ICollection o114 = ob.@ExtensibleAttributes;
2330                         if (o114 != null) {
2331                                 foreach (XmlAttribute o115 in o114)
2332                                         if (o115.NamespaceURI != xmlNamespace)
2333                                                 WriteXmlAttribute (o115, ob);
2334                         }
2335
2336                         WriteAttribute ("name", "", ob.@Name);
2337
2338                         ServiceDescription.WriteExtensions (Writer, ob);
2339                         if (ob.@DocumentationElement != null) {
2340                                 XmlNode o116 = ob.@DocumentationElement;
2341                                 if (o116 is XmlElement) {
2342                                 if ((o116.LocalName == "documentation" && o116.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2343                                         }
2344                                         else o116.WriteTo (Writer);
2345                                         WriteElementLiteral (o116, "", "", false, true);
2346                                 }
2347                                 else
2348                                         throw CreateUnknownAnyElementException (o116.Name, o116.NamespaceURI);
2349                         }
2350                         if (writeWrappingElem) WriteEndElement (ob);
2351                 }
2352
2353                 void WriteObject_InputBinding (System.Web.Services.Description.InputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2354                 {
2355                         if (((object)ob) == null)
2356                         {
2357                                 if (isNullable)
2358                                         WriteNullTagLiteral(element, namesp);
2359                                 return;
2360                         }
2361
2362                         System.Type type = ob.GetType ();
2363                         if (type == typeof(System.Web.Services.Description.InputBinding))
2364                         { }
2365                         else {
2366                                 throw CreateUnknownTypeException (ob);
2367                         }
2368
2369                         if (writeWrappingElem) {
2370                                 WriteStartElement (element, namesp, ob);
2371                         }
2372
2373                         if (needType) WriteXsiType("InputBinding", "http://schemas.xmlsoap.org/wsdl/");
2374
2375                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2376
2377                         ICollection o117 = ob.@ExtensibleAttributes;
2378                         if (o117 != null) {
2379                                 foreach (XmlAttribute o118 in o117)
2380                                         if (o118.NamespaceURI != xmlNamespace)
2381                                                 WriteXmlAttribute (o118, ob);
2382                         }
2383
2384                         WriteAttribute ("name", "", ob.@Name);
2385
2386                         ServiceDescription.WriteExtensions (Writer, ob);
2387                         if (ob.@DocumentationElement != null) {
2388                                 XmlNode o119 = ob.@DocumentationElement;
2389                                 if (o119 is XmlElement) {
2390                                 if ((o119.LocalName == "documentation" && o119.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2391                                         }
2392                                         else o119.WriteTo (Writer);
2393                                         WriteElementLiteral (o119, "", "", false, true);
2394                                 }
2395                                 else
2396                                         throw CreateUnknownAnyElementException (o119.Name, o119.NamespaceURI);
2397                         }
2398                         if (writeWrappingElem) WriteEndElement (ob);
2399                 }
2400
2401                 void WriteObject_OutputBinding (System.Web.Services.Description.OutputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
2402                 {
2403                         if (((object)ob) == null)
2404                         {
2405                                 if (isNullable)
2406                                         WriteNullTagLiteral(element, namesp);
2407                                 return;
2408                         }
2409
2410                         System.Type type = ob.GetType ();
2411                         if (type == typeof(System.Web.Services.Description.OutputBinding))
2412                         { }
2413                         else {
2414                                 throw CreateUnknownTypeException (ob);
2415                         }
2416
2417                         if (writeWrappingElem) {
2418                                 WriteStartElement (element, namesp, ob);
2419                         }
2420
2421                         if (needType) WriteXsiType("OutputBinding", "http://schemas.xmlsoap.org/wsdl/");
2422
2423                         WriteNamespaceDeclarations ((XmlSerializerNamespaces) ob.@Namespaces);
2424
2425                         ICollection o120 = ob.@ExtensibleAttributes;
2426                         if (o120 != null) {
2427                                 foreach (XmlAttribute o121 in o120)
2428                                         if (o121.NamespaceURI != xmlNamespace)
2429                                                 WriteXmlAttribute (o121, ob);
2430                         }
2431
2432                         WriteAttribute ("name", "", ob.@Name);
2433
2434                         ServiceDescription.WriteExtensions (Writer, ob);
2435                         if (ob.@DocumentationElement != null) {
2436                                 XmlNode o122 = ob.@DocumentationElement;
2437                                 if (o122 is XmlElement) {
2438                                 if ((o122.LocalName == "documentation" && o122.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/")) {
2439                                         }
2440                                         else o122.WriteTo (Writer);
2441                                         WriteElementLiteral (o122, "", "", false, true);
2442                                 }
2443                                 else
2444                                         throw CreateUnknownAnyElementException (o122.Name, o122.NamespaceURI);
2445                         }
2446                         if (writeWrappingElem) WriteEndElement (ob);
2447                 }
2448
2449                 protected override void InitCallbacks ()
2450                 {
2451                 }
2452
2453         }
2454
2455
2456         internal class BaseXmlSerializer : System.Xml.Serialization.XmlSerializer
2457         {
2458                 protected override System.Xml.Serialization.XmlSerializationReader CreateReader () {
2459                         return new ServiceDescriptionReaderBase ();
2460                 }
2461
2462                 protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter () {
2463                         return new ServiceDescriptionWriterBase ();
2464                 }
2465
2466                 public override bool CanDeserialize (System.Xml.XmlReader xmlReader) {
2467                         return true;
2468                 }
2469         }
2470
2471         internal sealed class definitionsSerializer : BaseXmlSerializer
2472         {
2473                 protected override void Serialize (object obj, System.Xml.Serialization.XmlSerializationWriter writer) {
2474                         ((ServiceDescriptionWriterBase)writer).WriteRoot_ServiceDescription(obj);
2475                 }
2476
2477                 protected override object Deserialize (System.Xml.Serialization.XmlSerializationReader reader) {
2478                         return ((ServiceDescriptionReaderBase)reader).ReadRoot_ServiceDescription();
2479                 }
2480         }
2481
2482         #if !TARGET_JVM
2483         internal class XmlSerializerContract : System.Xml.Serialization.XmlSerializerImplementation
2484         {
2485                 System.Collections.Hashtable readMethods = null;
2486                 System.Collections.Hashtable writeMethods = null;
2487                 System.Collections.Hashtable typedSerializers = null;
2488
2489                 public override System.Xml.Serialization.XmlSerializationReader Reader {
2490                         get {
2491                                 return new ServiceDescriptionReaderBase();
2492                         }
2493                 }
2494
2495                 public override System.Xml.Serialization.XmlSerializationWriter Writer {
2496                         get {
2497                                 return new ServiceDescriptionWriterBase();
2498                         }
2499                 }
2500
2501                 public override System.Collections.Hashtable ReadMethods {
2502                         get {
2503                                 lock (this) {
2504                                         if (readMethods == null) {
2505                                                 readMethods = new System.Collections.Hashtable ();
2506                                                 readMethods.Add (@"System.Web.Services.Description.ServiceDescription", @"ReadRoot_ServiceDescription");
2507                                         }
2508                                         return readMethods;
2509                                 }
2510                         }
2511                 }
2512
2513                 public override System.Collections.Hashtable WriteMethods {
2514                         get {
2515                                 lock (this) {
2516                                         if (writeMethods == null) {
2517                                                 writeMethods = new System.Collections.Hashtable ();
2518                                                 writeMethods.Add (@"System.Web.Services.Description.ServiceDescription", @"WriteRoot_ServiceDescription");
2519                                         }
2520                                         return writeMethods;
2521                                 }
2522                         }
2523                 }
2524
2525                 public override System.Collections.Hashtable TypedSerializers {
2526                         get {
2527                                 lock (this) {
2528                                         if (typedSerializers == null) {
2529                                                 typedSerializers = new System.Collections.Hashtable ();
2530                                                 typedSerializers.Add (@"System.Web.Services.Description.ServiceDescription", new definitionsSerializer());
2531                                         }
2532                                         return typedSerializers;
2533                                 }
2534                         }
2535                 }
2536
2537                 public override XmlSerializer GetSerializer (Type type)
2538                 {
2539                         switch (type.FullName) {
2540                         case "System.Web.Services.Description.ServiceDescription":
2541                                 return (XmlSerializer) TypedSerializers ["System.Web.Services.Description.ServiceDescription"];
2542
2543                         }
2544                         return base.GetSerializer (type);
2545                 }
2546
2547                 public override bool CanSerialize (System.Type type) {
2548                         if (type == typeof(System.Web.Services.Description.ServiceDescription)) return true;
2549                         return false;
2550                 }
2551         }
2552
2553         #endif
2554 }
2555
2556 #endif