* ExtensionManager.cs: Added
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Description / ServiceDescriptionSerializerBase.cs
1 using System;
2 using System.Xml;
3 using System.Xml.Serialization;
4 using System.Text;
5 using System.Collections;
6 using System.Globalization;
7
8 namespace System.Web.Services.Description
9 {
10         public class ServiceDescriptionReaderBase : XmlSerializationReader
11         {
12                 public System.Web.Services.Description.ServiceDescription ReadTree ()
13                 {
14                         Reader.MoveToContent();
15                         return ReadObject_ServiceDescription (true, true);
16                 }
17
18                 public System.Web.Services.Description.ServiceDescription ReadObject_ServiceDescription (bool isNullable, bool checkType)
19                 {
20                         System.Web.Services.Description.ServiceDescription ob = null;
21                         if (isNullable && ReadNull()) return null;
22
23                         if (checkType) 
24                         {
25                                 System.Xml.XmlQualifiedName t = GetXsiType();
26                                 if (t != null) 
27                                 {
28                                         if (t.Name != "ServiceDescription" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
29                                                 throw CreateUnknownTypeException(t);
30                                 }
31                         }
32
33                         ob = new System.Web.Services.Description.ServiceDescription ();
34
35                         Reader.MoveToElement();
36
37                         while (Reader.MoveToNextAttribute())
38                         {
39                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
40                                         ob.Name = Reader.Value;
41                                 }
42                                 else if (Reader.LocalName == "targetNamespace" && Reader.NamespaceURI == "") {
43                                         ob.TargetNamespace = Reader.Value;
44                                 }
45                                 else if (IsXmlnsAttribute (Reader.Name)) {
46                                 }
47                                 else {
48                                         UnknownNode (ob);
49                                 }
50                         }
51
52                         Reader.MoveToElement();
53                         if (Reader.IsEmptyElement) {
54                                 Reader.Skip ();
55                                 return ob;
56                         }
57
58                         Reader.ReadStartElement();
59                         Reader.MoveToContent();
60
61                         bool b0=false, b1=false, b2=false, b3=false, b4=false, b5=false, b6=false;
62
63                         System.Web.Services.Description.ImportCollection o8 = ob.Imports;
64                         System.Web.Services.Description.MessageCollection o10 = ob.Messages;
65                         System.Web.Services.Description.PortTypeCollection o12 = ob.PortTypes;
66                         System.Web.Services.Description.BindingCollection o14 = ob.Bindings;
67                         System.Web.Services.Description.ServiceCollection o16 = ob.Services;
68                         int n7=0, n9=0, n11=0, n13=0, n15=0;
69
70                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
71                         {
72                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
73                                 {
74                                         if (Reader.LocalName == "binding" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b4) {
75                                                 if (o14 == null)
76                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.BindingCollection");
77                                                 o14.Add (ReadObject_Binding (false, true));
78                                                 n13++;
79                                         }
80                                         else if (Reader.LocalName == "service" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b5) {
81                                                 if (o16 == null)
82                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ServiceCollection");
83                                                 o16.Add (ReadObject_Service (false, true));
84                                                 n15++;
85                                         }
86                                         else if (Reader.LocalName == "import" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b0) {
87                                                 if (o8 == null)
88                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.ImportCollection");
89                                                 o8.Add (ReadObject_Import (false, true));
90                                                 n7++;
91                                         }
92                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b6) {
93                                                 b6 = true;
94                                                 ob.Documentation = Reader.ReadElementString ();
95                                         }
96                                         else if (Reader.LocalName == "message" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b2) {
97                                                 if (o10 == null)
98                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessageCollection");
99                                                 o10.Add (ReadObject_Message (false, true));
100                                                 n9++;
101                                         }
102                                         else if (Reader.LocalName == "types" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b1) {
103                                                 b1 = true;
104                                                 ob.Types = ReadObject_Types (false, true);
105                                         }
106                                         else if (Reader.LocalName == "portType" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b3) {
107                                                 if (o12 == null)
108                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortTypeCollection");
109                                                 o12.Add (ReadObject_PortType (false, true));
110                                                 n11++;
111                                         }
112                                         else {
113                                                 ServiceDescription.ReadExtension (Reader, ob);
114                                         }
115                                 }
116                                 else
117                                         UnknownNode(ob);
118
119                                 Reader.MoveToContent();
120                         }
121
122
123                         ReadEndElement();
124
125                         return ob;
126                 }
127
128                 public System.Web.Services.Description.Binding ReadObject_Binding (bool isNullable, bool checkType)
129                 {
130                         System.Web.Services.Description.Binding ob = null;
131                         if (isNullable && ReadNull()) return null;
132
133                         if (checkType) 
134                         {
135                                 System.Xml.XmlQualifiedName t = GetXsiType();
136                                 if (t != null) 
137                                 {
138                                         if (t.Name != "Binding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
139                                                 throw CreateUnknownTypeException(t);
140                                 }
141                         }
142
143                         ob = new System.Web.Services.Description.Binding ();
144
145                         Reader.MoveToElement();
146
147                         while (Reader.MoveToNextAttribute())
148                         {
149                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
150                                         ob.Name = Reader.Value;
151                                 }
152                                 else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
153                                         ob.Type = ToXmlQualifiedName (Reader.Value);
154                                 }
155                                 else if (IsXmlnsAttribute (Reader.Name)) {
156                                 }
157                                 else {
158                                         UnknownNode (ob);
159                                 }
160                         }
161
162                         Reader.MoveToElement();
163                         if (Reader.IsEmptyElement) {
164                                 Reader.Skip ();
165                                 return ob;
166                         }
167
168                         Reader.ReadStartElement();
169                         Reader.MoveToContent();
170
171                         bool b17=false, b18=false;
172
173                         System.Web.Services.Description.OperationBindingCollection o20 = ob.Operations;
174                         int n19=0;
175
176                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
177                         {
178                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
179                                 {
180                                         if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b17) {
181                                                 if (o20 == null)
182                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationBindingCollection");
183                                                 o20.Add (ReadObject_OperationBinding (false, true));
184                                                 n19++;
185                                         }
186                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b18) {
187                                                 b18 = true;
188                                                 ob.Documentation = Reader.ReadElementString ();
189                                         }
190                                         else {
191                                                 ServiceDescription.ReadExtension (Reader, ob);
192                                         }
193                                 }
194                                 else
195                                         UnknownNode(ob);
196
197                                 Reader.MoveToContent();
198                         }
199
200
201                         ReadEndElement();
202
203                         return ob;
204                 }
205
206                 public System.Web.Services.Description.Service ReadObject_Service (bool isNullable, bool checkType)
207                 {
208                         System.Web.Services.Description.Service ob = null;
209                         if (isNullable && ReadNull()) return null;
210
211                         if (checkType) 
212                         {
213                                 System.Xml.XmlQualifiedName t = GetXsiType();
214                                 if (t != null) 
215                                 {
216                                         if (t.Name != "Service" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
217                                                 throw CreateUnknownTypeException(t);
218                                 }
219                         }
220
221                         ob = new System.Web.Services.Description.Service ();
222
223                         Reader.MoveToElement();
224
225                         while (Reader.MoveToNextAttribute())
226                         {
227                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
228                                         ob.Name = Reader.Value;
229                                 }
230                                 else if (IsXmlnsAttribute (Reader.Name)) {
231                                 }
232                                 else {
233                                         UnknownNode (ob);
234                                 }
235                         }
236
237                         Reader.MoveToElement();
238                         if (Reader.IsEmptyElement) {
239                                 Reader.Skip ();
240                                 return ob;
241                         }
242
243                         Reader.ReadStartElement();
244                         Reader.MoveToContent();
245
246                         bool b21=false, b22=false;
247
248                         System.Web.Services.Description.PortCollection o24 = ob.Ports;
249                         int n23=0;
250
251                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
252                         {
253                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
254                                 {
255                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b22) {
256                                                 b22 = true;
257                                                 ob.Documentation = Reader.ReadElementString ();
258                                         }
259                                         else if (Reader.LocalName == "port" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b21) {
260                                                 if (o24 == null)
261                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.PortCollection");
262                                                 o24.Add (ReadObject_Port (false, true));
263                                                 n23++;
264                                         }
265                                         else {
266                                                 UnknownNode (ob);
267                                         }
268                                 }
269                                 else
270                                         UnknownNode(ob);
271
272                                 Reader.MoveToContent();
273                         }
274
275
276                         ReadEndElement();
277
278                         return ob;
279                 }
280
281                 public System.Web.Services.Description.Import ReadObject_Import (bool isNullable, bool checkType)
282                 {
283                         System.Web.Services.Description.Import ob = null;
284                         if (isNullable && ReadNull()) return null;
285
286                         if (checkType) 
287                         {
288                                 System.Xml.XmlQualifiedName t = GetXsiType();
289                                 if (t != null) 
290                                 {
291                                         if (t.Name != "Import" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
292                                                 throw CreateUnknownTypeException(t);
293                                 }
294                         }
295
296                         ob = new System.Web.Services.Description.Import ();
297
298                         Reader.MoveToElement();
299
300                         while (Reader.MoveToNextAttribute())
301                         {
302                                 if (Reader.LocalName == "namespace" && Reader.NamespaceURI == "") {
303                                         ob.Namespace = Reader.Value;
304                                 }
305                                 else if (Reader.LocalName == "location" && Reader.NamespaceURI == "") {
306                                         ob.Location = Reader.Value;
307                                 }
308                                 else if (IsXmlnsAttribute (Reader.Name)) {
309                                 }
310                                 else {
311                                         UnknownNode (ob);
312                                 }
313                         }
314
315                         Reader.MoveToElement();
316                         if (Reader.IsEmptyElement) {
317                                 Reader.Skip ();
318                                 return ob;
319                         }
320
321                         Reader.ReadStartElement();
322                         Reader.MoveToContent();
323
324                         bool b25=false;
325
326                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
327                         {
328                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
329                                 {
330                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b25) {
331                                                 b25 = true;
332                                                 ob.Documentation = Reader.ReadElementString ();
333                                         }
334                                         else {
335                                                 UnknownNode (ob);
336                                         }
337                                 }
338                                 else
339                                         UnknownNode(ob);
340
341                                 Reader.MoveToContent();
342                         }
343
344                         ReadEndElement();
345
346                         return ob;
347                 }
348
349                 public System.Web.Services.Description.Message ReadObject_Message (bool isNullable, bool checkType)
350                 {
351                         System.Web.Services.Description.Message ob = null;
352                         if (isNullable && ReadNull()) return null;
353
354                         if (checkType) 
355                         {
356                                 System.Xml.XmlQualifiedName t = GetXsiType();
357                                 if (t != null) 
358                                 {
359                                         if (t.Name != "Message" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
360                                                 throw CreateUnknownTypeException(t);
361                                 }
362                         }
363
364                         ob = new System.Web.Services.Description.Message ();
365
366                         Reader.MoveToElement();
367
368                         while (Reader.MoveToNextAttribute())
369                         {
370                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
371                                         ob.Name = Reader.Value;
372                                 }
373                                 else if (IsXmlnsAttribute (Reader.Name)) {
374                                 }
375                                 else {
376                                         UnknownNode (ob);
377                                 }
378                         }
379
380                         Reader.MoveToElement();
381                         if (Reader.IsEmptyElement) {
382                                 Reader.Skip ();
383                                 return ob;
384                         }
385
386                         Reader.ReadStartElement();
387                         Reader.MoveToContent();
388
389                         bool b26=false, b27=false;
390
391                         System.Web.Services.Description.MessagePartCollection o29 = ob.Parts;
392                         int n28=0;
393
394                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
395                         {
396                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
397                                 {
398                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b27) {
399                                                 b27 = true;
400                                                 ob.Documentation = Reader.ReadElementString ();
401                                         }
402                                         else if (Reader.LocalName == "part" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b26) {
403                                                 if (o29 == null)
404                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.MessagePartCollection");
405                                                 o29.Add (ReadObject_MessagePart (false, true));
406                                                 n28++;
407                                         }
408                                         else {
409                                                 UnknownNode (ob);
410                                         }
411                                 }
412                                 else
413                                         UnknownNode(ob);
414
415                                 Reader.MoveToContent();
416                         }
417
418
419                         ReadEndElement();
420
421                         return ob;
422                 }
423
424                 public System.Web.Services.Description.Types ReadObject_Types (bool isNullable, bool checkType)
425                 {
426                         System.Web.Services.Description.Types ob = null;
427                         if (isNullable && ReadNull()) return null;
428
429                         if (checkType) 
430                         {
431                                 System.Xml.XmlQualifiedName t = GetXsiType();
432                                 if (t != null) 
433                                 {
434                                         if (t.Name != "Types" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
435                                                 throw CreateUnknownTypeException(t);
436                                 }
437                         }
438
439                         ob = new System.Web.Services.Description.Types ();
440
441                         Reader.MoveToElement();
442
443                         while (Reader.MoveToNextAttribute())
444                         {
445                                 if (IsXmlnsAttribute (Reader.Name)) {
446                                 }
447                                 else {
448                                         UnknownNode (ob);
449                                 }
450                         }
451
452                         Reader.MoveToElement();
453                         if (Reader.IsEmptyElement) {
454                                 Reader.Skip ();
455                                 return ob;
456                         }
457
458                         Reader.ReadStartElement();
459                         Reader.MoveToContent();
460
461                         bool b30=false, b31=false;
462
463                         System.Xml.Serialization.XmlSchemas o33 = ob.Schemas;
464                         int n32=0;
465
466                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
467                         {
468                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
469                                 {
470                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b31) {
471                                                 b31 = true;
472                                                 ob.Documentation = Reader.ReadElementString ();
473                                         }
474                                         else if (Reader.LocalName == "schema" && Reader.NamespaceURI == "http://www.w3.org/2001/XMLSchema" && !b30) {
475                                                 if (o33 == null)
476                                                         throw CreateReadOnlyCollectionException ("System.Xml.Serialization.XmlSchemas");
477                                                 o33.Add (ReadObject_XmlSchema (false, true));
478                                                 n32++;
479                                         }
480                                         else {
481                                                 ServiceDescription.ReadExtension (Reader, ob);
482                                         }
483                                 }
484                                 else
485                                         UnknownNode(ob);
486
487                                 Reader.MoveToContent();
488                         }
489
490
491                         ReadEndElement();
492
493                         return ob;
494                 }
495
496                 public System.Web.Services.Description.PortType ReadObject_PortType (bool isNullable, bool checkType)
497                 {
498                         System.Web.Services.Description.PortType ob = null;
499                         if (isNullable && ReadNull()) return null;
500
501                         if (checkType) 
502                         {
503                                 System.Xml.XmlQualifiedName t = GetXsiType();
504                                 if (t != null) 
505                                 {
506                                         if (t.Name != "PortType" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
507                                                 throw CreateUnknownTypeException(t);
508                                 }
509                         }
510
511                         ob = new System.Web.Services.Description.PortType ();
512
513                         Reader.MoveToElement();
514
515                         while (Reader.MoveToNextAttribute())
516                         {
517                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
518                                         ob.Name = Reader.Value;
519                                 }
520                                 else if (IsXmlnsAttribute (Reader.Name)) {
521                                 }
522                                 else {
523                                         UnknownNode (ob);
524                                 }
525                         }
526
527                         Reader.MoveToElement();
528                         if (Reader.IsEmptyElement) {
529                                 Reader.Skip ();
530                                 return ob;
531                         }
532
533                         Reader.ReadStartElement();
534                         Reader.MoveToContent();
535
536                         bool b34=false, b35=false;
537
538                         System.Web.Services.Description.OperationCollection o37 = ob.Operations;
539                         int n36=0;
540
541                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
542                         {
543                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
544                                 {
545                                         if (Reader.LocalName == "operation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b34) {
546                                                 if (o37 == null)
547                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationCollection");
548                                                 o37.Add (ReadObject_Operation (false, true));
549                                                 n36++;
550                                         }
551                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b35) {
552                                                 b35 = true;
553                                                 ob.Documentation = Reader.ReadElementString ();
554                                         }
555                                         else {
556                                                 UnknownNode (ob);
557                                         }
558                                 }
559                                 else
560                                         UnknownNode(ob);
561
562                                 Reader.MoveToContent();
563                         }
564
565
566                         ReadEndElement();
567
568                         return ob;
569                 }
570
571                 public System.Web.Services.Description.OperationBinding ReadObject_OperationBinding (bool isNullable, bool checkType)
572                 {
573                         System.Web.Services.Description.OperationBinding ob = null;
574                         if (isNullable && ReadNull()) return null;
575
576                         if (checkType) 
577                         {
578                                 System.Xml.XmlQualifiedName t = GetXsiType();
579                                 if (t != null) 
580                                 {
581                                         if (t.Name != "OperationBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
582                                                 throw CreateUnknownTypeException(t);
583                                 }
584                         }
585
586                         ob = new System.Web.Services.Description.OperationBinding ();
587
588                         Reader.MoveToElement();
589
590                         while (Reader.MoveToNextAttribute())
591                         {
592                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
593                                         ob.Name = Reader.Value;
594                                 }
595                                 else if (IsXmlnsAttribute (Reader.Name)) {
596                                 }
597                                 else {
598                                         UnknownNode (ob);
599                                 }
600                         }
601
602                         Reader.MoveToElement();
603                         if (Reader.IsEmptyElement) {
604                                 Reader.Skip ();
605                                 return ob;
606                         }
607
608                         Reader.ReadStartElement();
609                         Reader.MoveToContent();
610
611                         bool b38=false, b39=false, b40=false, b41=false;
612
613                         System.Web.Services.Description.FaultBindingCollection o43 = ob.Faults;
614                         int n42=0;
615
616                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
617                         {
618                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
619                                 {
620                                         if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b39) {
621                                                 b39 = true;
622                                                 ob.Input = ReadObject_InputBinding (false, true);
623                                         }
624                                         else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b38) {
625                                                 if (o43 == null)
626                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.FaultBindingCollection");
627                                                 o43.Add (ReadObject_FaultBinding (false, true));
628                                                 n42++;
629                                         }
630                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b41) {
631                                                 b41 = true;
632                                                 ob.Documentation = Reader.ReadElementString ();
633                                         }
634                                         else if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b40) {
635                                                 b40 = true;
636                                                 ob.Output = ReadObject_OutputBinding (false, true);
637                                         }
638                                         else {
639                                                 ServiceDescription.ReadExtension (Reader, ob);
640                                         }
641                                 }
642                                 else
643                                         UnknownNode(ob);
644
645                                 Reader.MoveToContent();
646                         }
647
648
649                         ReadEndElement();
650
651                         return ob;
652                 }
653
654                 public System.Web.Services.Description.Port ReadObject_Port (bool isNullable, bool checkType)
655                 {
656                         System.Web.Services.Description.Port ob = null;
657                         if (isNullable && ReadNull()) return null;
658
659                         if (checkType) 
660                         {
661                                 System.Xml.XmlQualifiedName t = GetXsiType();
662                                 if (t != null) 
663                                 {
664                                         if (t.Name != "Port" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
665                                                 throw CreateUnknownTypeException(t);
666                                 }
667                         }
668
669                         ob = new System.Web.Services.Description.Port ();
670
671                         Reader.MoveToElement();
672
673                         while (Reader.MoveToNextAttribute())
674                         {
675                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
676                                         ob.Name = Reader.Value;
677                                 }
678                                 else if (Reader.LocalName == "binding" && Reader.NamespaceURI == "") {
679                                         ob.Binding = ToXmlQualifiedName (Reader.Value);
680                                 }
681                                 else if (IsXmlnsAttribute (Reader.Name)) {
682                                 }
683                                 else {
684                                         UnknownNode (ob);
685                                 }
686                         }
687
688                         Reader.MoveToElement();
689                         if (Reader.IsEmptyElement) {
690                                 Reader.Skip ();
691                                 return ob;
692                         }
693
694                         Reader.ReadStartElement();
695                         Reader.MoveToContent();
696
697                         bool b44=false;
698
699                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
700                         {
701                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
702                                 {
703                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b44) {
704                                                 b44 = true;
705                                                 ob.Documentation = Reader.ReadElementString ();
706                                         }
707                                         else {
708                                                 ServiceDescription.ReadExtension (Reader, ob);
709                                         }
710                                 }
711                                 else
712                                         UnknownNode(ob);
713
714                                 Reader.MoveToContent();
715                         }
716
717                         ReadEndElement();
718
719                         return ob;
720                 }
721
722                 public System.Web.Services.Description.MessagePart ReadObject_MessagePart (bool isNullable, bool checkType)
723                 {
724                         System.Web.Services.Description.MessagePart ob = null;
725                         if (isNullable && ReadNull()) return null;
726
727                         if (checkType) 
728                         {
729                                 System.Xml.XmlQualifiedName t = GetXsiType();
730                                 if (t != null) 
731                                 {
732                                         if (t.Name != "MessagePart" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
733                                                 throw CreateUnknownTypeException(t);
734                                 }
735                         }
736
737                         ob = new System.Web.Services.Description.MessagePart ();
738
739                         Reader.MoveToElement();
740
741                         while (Reader.MoveToNextAttribute())
742                         {
743                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
744                                         ob.Name = Reader.Value;
745                                 }
746                                 else if (Reader.LocalName == "element" && Reader.NamespaceURI == "") {
747                                         ob.Element = ToXmlQualifiedName (Reader.Value);
748                                 }
749                                 else if (Reader.LocalName == "type" && Reader.NamespaceURI == "") {
750                                         ob.Type = ToXmlQualifiedName (Reader.Value);
751                                 }
752                                 else if (IsXmlnsAttribute (Reader.Name)) {
753                                 }
754                                 else {
755                                         UnknownNode (ob);
756                                 }
757                         }
758
759                         Reader.MoveToElement();
760                         if (Reader.IsEmptyElement) {
761                                 Reader.Skip ();
762                                 return ob;
763                         }
764
765                         Reader.ReadStartElement();
766                         Reader.MoveToContent();
767
768                         bool b45=false;
769
770                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
771                         {
772                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
773                                 {
774                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b45) {
775                                                 b45 = true;
776                                                 ob.Documentation = Reader.ReadElementString ();
777                                         }
778                                         else {
779                                                 UnknownNode (ob);
780                                         }
781                                 }
782                                 else
783                                         UnknownNode(ob);
784
785                                 Reader.MoveToContent();
786                         }
787
788                         ReadEndElement();
789
790                         return ob;
791                 }
792
793                 public System.Xml.Schema.XmlSchema ReadObject_XmlSchema (bool isNullable, bool checkType)
794                 {
795                         System.Xml.Schema.XmlSchema ob = null;
796                         ob = System.Xml.Schema.XmlSchema.Read (Reader, null);
797                         return ob;
798                 }
799
800                 public System.Web.Services.Description.Operation ReadObject_Operation (bool isNullable, bool checkType)
801                 {
802                         System.Web.Services.Description.Operation ob = null;
803                         if (isNullable && ReadNull()) return null;
804
805                         if (checkType) 
806                         {
807                                 System.Xml.XmlQualifiedName t = GetXsiType();
808                                 if (t != null) 
809                                 {
810                                         if (t.Name != "Operation" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
811                                                 throw CreateUnknownTypeException(t);
812                                 }
813                         }
814
815                         ob = new System.Web.Services.Description.Operation ();
816
817                         Reader.MoveToElement();
818
819                         while (Reader.MoveToNextAttribute())
820                         {
821                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
822                                         ob.Name = Reader.Value;
823                                 }
824                                 else if (Reader.LocalName == "parameterOrder" && Reader.NamespaceURI == "") {
825                                         ob.ParameterOrderString = Reader.Value;
826                                 }
827                                 else if (IsXmlnsAttribute (Reader.Name)) {
828                                 }
829                                 else {
830                                         UnknownNode (ob);
831                                 }
832                         }
833
834                         Reader.MoveToElement();
835                         if (Reader.IsEmptyElement) {
836                                 Reader.Skip ();
837                                 return ob;
838                         }
839
840                         Reader.ReadStartElement();
841                         Reader.MoveToContent();
842
843                         bool b46=false, b47=false, b48=false;
844
845                         System.Web.Services.Description.OperationFaultCollection o50 = ob.Faults;
846                         System.Web.Services.Description.OperationMessageCollection o52 = ob.Messages;
847                         int n49=0, n51=0;
848
849                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
850                         {
851                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
852                                 {
853                                         if (Reader.LocalName == "input" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b47) {
854                                                 if (o52 == null)
855                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
856                                                 o52.Add (ReadObject_OperationInput (false, true));
857                                                 n51++;
858                                         }
859                                         else if (Reader.LocalName == "fault" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b46) {
860                                                 if (o50 == null)
861                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationFaultCollection");
862                                                 o50.Add (ReadObject_OperationFault (false, true));
863                                                 n49++;
864                                         }
865                                         else if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b48) {
866                                                 b48 = true;
867                                                 ob.Documentation = Reader.ReadElementString ();
868                                         }
869                                         else if (Reader.LocalName == "output" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b47) {
870                                                 if (o52 == null)
871                                                         throw CreateReadOnlyCollectionException ("System.Web.Services.Description.OperationMessageCollection");
872                                                 o52.Add (ReadObject_OperationOutput (false, true));
873                                                 n51++;
874                                         }
875                                         else {
876                                                 UnknownNode (ob);
877                                         }
878                                 }
879                                 else
880                                         UnknownNode(ob);
881
882                                 Reader.MoveToContent();
883                         }
884
885
886                         ReadEndElement();
887
888                         return ob;
889                 }
890
891                 public System.Web.Services.Description.InputBinding ReadObject_InputBinding (bool isNullable, bool checkType)
892                 {
893                         System.Web.Services.Description.InputBinding ob = null;
894                         if (isNullable && ReadNull()) return null;
895
896                         if (checkType) 
897                         {
898                                 System.Xml.XmlQualifiedName t = GetXsiType();
899                                 if (t != null) 
900                                 {
901                                         if (t.Name != "InputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
902                                                 throw CreateUnknownTypeException(t);
903                                 }
904                         }
905
906                         ob = new System.Web.Services.Description.InputBinding ();
907
908                         Reader.MoveToElement();
909
910                         while (Reader.MoveToNextAttribute())
911                         {
912                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
913                                         ob.Name = Reader.Value;
914                                 }
915                                 else if (IsXmlnsAttribute (Reader.Name)) {
916                                 }
917                                 else {
918                                         UnknownNode (ob);
919                                 }
920                         }
921
922                         Reader.MoveToElement();
923                         if (Reader.IsEmptyElement) {
924                                 Reader.Skip ();
925                                 return ob;
926                         }
927
928                         Reader.ReadStartElement();
929                         Reader.MoveToContent();
930
931                         bool b53=false;
932
933                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
934                         {
935                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
936                                 {
937                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b53) {
938                                                 b53 = true;
939                                                 ob.Documentation = Reader.ReadElementString ();
940                                         }
941                                         else {
942                                                 ServiceDescription.ReadExtension (Reader, ob);
943                                         }
944                                 }
945                                 else
946                                         UnknownNode(ob);
947
948                                 Reader.MoveToContent();
949                         }
950
951                         ReadEndElement();
952
953                         return ob;
954                 }
955
956                 public System.Web.Services.Description.FaultBinding ReadObject_FaultBinding (bool isNullable, bool checkType)
957                 {
958                         System.Web.Services.Description.FaultBinding ob = null;
959                         if (isNullable && ReadNull()) return null;
960
961                         if (checkType) 
962                         {
963                                 System.Xml.XmlQualifiedName t = GetXsiType();
964                                 if (t != null) 
965                                 {
966                                         if (t.Name != "FaultBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
967                                                 throw CreateUnknownTypeException(t);
968                                 }
969                         }
970
971                         ob = new System.Web.Services.Description.FaultBinding ();
972
973                         Reader.MoveToElement();
974
975                         while (Reader.MoveToNextAttribute())
976                         {
977                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
978                                         ob.Name = Reader.Value;
979                                 }
980                                 else if (IsXmlnsAttribute (Reader.Name)) {
981                                 }
982                                 else {
983                                         UnknownNode (ob);
984                                 }
985                         }
986
987                         Reader.MoveToElement();
988                         if (Reader.IsEmptyElement) {
989                                 Reader.Skip ();
990                                 return ob;
991                         }
992
993                         Reader.ReadStartElement();
994                         Reader.MoveToContent();
995
996                         bool b54=false;
997
998                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
999                         {
1000                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1001                                 {
1002                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b54) {
1003                                                 b54 = true;
1004                                                 ob.Documentation = Reader.ReadElementString ();
1005                                         }
1006                                         else {
1007                                                 ServiceDescription.ReadExtension (Reader, ob);
1008                                         }
1009                                 }
1010                                 else
1011                                         UnknownNode(ob);
1012
1013                                 Reader.MoveToContent();
1014                         }
1015
1016                         ReadEndElement();
1017
1018                         return ob;
1019                 }
1020
1021                 public System.Web.Services.Description.OutputBinding ReadObject_OutputBinding (bool isNullable, bool checkType)
1022                 {
1023                         System.Web.Services.Description.OutputBinding ob = null;
1024                         if (isNullable && ReadNull()) return null;
1025
1026                         if (checkType) 
1027                         {
1028                                 System.Xml.XmlQualifiedName t = GetXsiType();
1029                                 if (t != null) 
1030                                 {
1031                                         if (t.Name != "OutputBinding" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1032                                                 throw CreateUnknownTypeException(t);
1033                                 }
1034                         }
1035
1036                         ob = new System.Web.Services.Description.OutputBinding ();
1037
1038                         Reader.MoveToElement();
1039
1040                         while (Reader.MoveToNextAttribute())
1041                         {
1042                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1043                                         ob.Name = Reader.Value;
1044                                 }
1045                                 else if (IsXmlnsAttribute (Reader.Name)) {
1046                                 }
1047                                 else {
1048                                         UnknownNode (ob);
1049                                 }
1050                         }
1051
1052                         Reader.MoveToElement();
1053                         if (Reader.IsEmptyElement) {
1054                                 Reader.Skip ();
1055                                 return ob;
1056                         }
1057
1058                         Reader.ReadStartElement();
1059                         Reader.MoveToContent();
1060
1061                         bool b55=false;
1062
1063                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1064                         {
1065                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1066                                 {
1067                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b55) {
1068                                                 b55 = true;
1069                                                 ob.Documentation = Reader.ReadElementString ();
1070                                         }
1071                                         else {
1072                                                 ServiceDescription.ReadExtension (Reader, ob);
1073                                         }
1074                                 }
1075                                 else
1076                                         UnknownNode(ob);
1077
1078                                 Reader.MoveToContent();
1079                         }
1080
1081                         ReadEndElement();
1082
1083                         return ob;
1084                 }
1085
1086                 public System.Web.Services.Description.OperationInput ReadObject_OperationInput (bool isNullable, bool checkType)
1087                 {
1088                         System.Web.Services.Description.OperationInput ob = null;
1089                         if (isNullable && ReadNull()) return null;
1090
1091                         if (checkType) 
1092                         {
1093                                 System.Xml.XmlQualifiedName t = GetXsiType();
1094                                 if (t != null) 
1095                                 {
1096                                         if (t.Name != "OperationInput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1097                                                 throw CreateUnknownTypeException(t);
1098                                 }
1099                         }
1100
1101                         ob = new System.Web.Services.Description.OperationInput ();
1102
1103                         Reader.MoveToElement();
1104
1105                         while (Reader.MoveToNextAttribute())
1106                         {
1107                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1108                                         ob.Name = Reader.Value;
1109                                 }
1110                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1111                                         ob.Message = ToXmlQualifiedName (Reader.Value);
1112                                 }
1113                                 else if (IsXmlnsAttribute (Reader.Name)) {
1114                                 }
1115                                 else {
1116                                         UnknownNode (ob);
1117                                 }
1118                         }
1119
1120                         Reader.MoveToElement();
1121                         if (Reader.IsEmptyElement) {
1122                                 Reader.Skip ();
1123                                 return ob;
1124                         }
1125
1126                         Reader.ReadStartElement();
1127                         Reader.MoveToContent();
1128
1129                         bool b56=false;
1130
1131                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1132                         {
1133                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1134                                 {
1135                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b56) {
1136                                                 b56 = true;
1137                                                 ob.Documentation = Reader.ReadElementString ();
1138                                         }
1139                                         else {
1140                                                 UnknownNode (ob);
1141                                         }
1142                                 }
1143                                 else
1144                                         UnknownNode(ob);
1145
1146                                 Reader.MoveToContent();
1147                         }
1148
1149                         ReadEndElement();
1150
1151                         return ob;
1152                 }
1153
1154                 public System.Web.Services.Description.OperationFault ReadObject_OperationFault (bool isNullable, bool checkType)
1155                 {
1156                         System.Web.Services.Description.OperationFault ob = null;
1157                         if (isNullable && ReadNull()) return null;
1158
1159                         if (checkType) 
1160                         {
1161                                 System.Xml.XmlQualifiedName t = GetXsiType();
1162                                 if (t != null) 
1163                                 {
1164                                         if (t.Name != "OperationFault" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1165                                                 throw CreateUnknownTypeException(t);
1166                                 }
1167                         }
1168
1169                         ob = new System.Web.Services.Description.OperationFault ();
1170
1171                         Reader.MoveToElement();
1172
1173                         while (Reader.MoveToNextAttribute())
1174                         {
1175                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1176                                         ob.Name = Reader.Value;
1177                                 }
1178                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1179                                         ob.Message = ToXmlQualifiedName (Reader.Value);
1180                                 }
1181                                 else if (IsXmlnsAttribute (Reader.Name)) {
1182                                 }
1183                                 else {
1184                                         UnknownNode (ob);
1185                                 }
1186                         }
1187
1188                         Reader.MoveToElement();
1189                         if (Reader.IsEmptyElement) {
1190                                 Reader.Skip ();
1191                                 return ob;
1192                         }
1193
1194                         Reader.ReadStartElement();
1195                         Reader.MoveToContent();
1196
1197                         bool b57=false;
1198
1199                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1200                         {
1201                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1202                                 {
1203                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b57) {
1204                                                 b57 = true;
1205                                                 ob.Documentation = Reader.ReadElementString ();
1206                                         }
1207                                         else {
1208                                                 UnknownNode (ob);
1209                                         }
1210                                 }
1211                                 else
1212                                         UnknownNode(ob);
1213
1214                                 Reader.MoveToContent();
1215                         }
1216
1217                         ReadEndElement();
1218
1219                         return ob;
1220                 }
1221
1222                 public System.Web.Services.Description.OperationOutput ReadObject_OperationOutput (bool isNullable, bool checkType)
1223                 {
1224                         System.Web.Services.Description.OperationOutput ob = null;
1225                         if (isNullable && ReadNull()) return null;
1226
1227                         if (checkType) 
1228                         {
1229                                 System.Xml.XmlQualifiedName t = GetXsiType();
1230                                 if (t != null) 
1231                                 {
1232                                         if (t.Name != "OperationOutput" || t.Namespace != "http://schemas.xmlsoap.org/wsdl/")
1233                                                 throw CreateUnknownTypeException(t);
1234                                 }
1235                         }
1236
1237                         ob = new System.Web.Services.Description.OperationOutput ();
1238
1239                         Reader.MoveToElement();
1240
1241                         while (Reader.MoveToNextAttribute())
1242                         {
1243                                 if (Reader.LocalName == "name" && Reader.NamespaceURI == "") {
1244                                         ob.Name = Reader.Value;
1245                                 }
1246                                 else if (Reader.LocalName == "message" && Reader.NamespaceURI == "") {
1247                                         ob.Message = ToXmlQualifiedName (Reader.Value);
1248                                 }
1249                                 else if (IsXmlnsAttribute (Reader.Name)) {
1250                                 }
1251                                 else {
1252                                         UnknownNode (ob);
1253                                 }
1254                         }
1255
1256                         Reader.MoveToElement();
1257                         if (Reader.IsEmptyElement) {
1258                                 Reader.Skip ();
1259                                 return ob;
1260                         }
1261
1262                         Reader.ReadStartElement();
1263                         Reader.MoveToContent();
1264
1265                         bool b58=false;
1266
1267                         while (Reader.NodeType != System.Xml.XmlNodeType.EndElement) 
1268                         {
1269                                 if (Reader.NodeType == System.Xml.XmlNodeType.Element) 
1270                                 {
1271                                         if (Reader.LocalName == "documentation" && Reader.NamespaceURI == "http://schemas.xmlsoap.org/wsdl/" && !b58) {
1272                                                 b58 = true;
1273                                                 ob.Documentation = Reader.ReadElementString ();
1274                                         }
1275                                         else {
1276                                                 UnknownNode (ob);
1277                                         }
1278                                 }
1279                                 else
1280                                         UnknownNode(ob);
1281
1282                                 Reader.MoveToContent();
1283                         }
1284
1285                         ReadEndElement();
1286
1287                         return ob;
1288                 }
1289
1290                 protected override void InitCallbacks ()
1291                 {
1292                 }
1293
1294                 protected override void InitIDs ()
1295                 {
1296                 }
1297
1298         }
1299
1300         public class ServiceDescriptionWriterBase : XmlSerializationWriter
1301         {
1302                 public void WriteTree (System.Web.Services.Description.ServiceDescription ob)
1303                 {
1304                         WriteStartDocument ();
1305                         TopLevelElement ();
1306                         WriteObject_ServiceDescription (ob, "definitions", "http://schemas.xmlsoap.org/wsdl/", true, false, true);
1307                 }
1308
1309                 void WriteObject_ServiceDescription (System.Web.Services.Description.ServiceDescription ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1310                 {
1311                         if (ob == null)
1312                         {
1313                                 if (isNullable)
1314                                         WriteNullTagLiteral(element, namesp);
1315                                 return;
1316                         }
1317
1318                         if (writeWrappingElem) {
1319                                 WriteStartElement (element, namesp, ob);
1320                         }
1321
1322                         if (needType) WriteXsiType("ServiceDescription", "http://schemas.xmlsoap.org/wsdl/");
1323
1324                         WriteAttribute ("name", "", ob.Name.ToString());
1325                         WriteAttribute ("targetNamespace", "", ob.TargetNamespace);
1326
1327                         ServiceDescription.WriteExtensions (Writer, ob);
1328                         if (ob.Imports != null) {
1329                                 for (int n59 = 0; n59 < ob.Imports.Count; n59++) {
1330                                         WriteObject_Import (ob.Imports[n59], "import", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1331                                 }
1332                         }
1333                         WriteObject_Types (ob.Types, "types", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1334                         if (ob.Messages != null) {
1335                                 for (int n60 = 0; n60 < ob.Messages.Count; n60++) {
1336                                         WriteObject_Message (ob.Messages[n60], "message", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1337                                 }
1338                         }
1339                         if (ob.PortTypes != null) {
1340                                 for (int n61 = 0; n61 < ob.PortTypes.Count; n61++) {
1341                                         WriteObject_PortType (ob.PortTypes[n61], "portType", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1342                                 }
1343                         }
1344                         if (ob.Bindings != null) {
1345                                 for (int n62 = 0; n62 < ob.Bindings.Count; n62++) {
1346                                         WriteObject_Binding (ob.Bindings[n62], "binding", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1347                                 }
1348                         }
1349                         if (ob.Services != null) {
1350                                 for (int n63 = 0; n63 < ob.Services.Count; n63++) {
1351                                         WriteObject_Service (ob.Services[n63], "service", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1352                                 }
1353                         }
1354                         if (ob.Documentation != "") {
1355                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1356                         }
1357                         if (writeWrappingElem) WriteEndElement (ob);
1358                 }
1359
1360                 void WriteObject_Import (System.Web.Services.Description.Import ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1361                 {
1362                         if (ob == null)
1363                         {
1364                                 if (isNullable)
1365                                         WriteNullTagLiteral(element, namesp);
1366                                 return;
1367                         }
1368
1369                         if (writeWrappingElem) {
1370                                 WriteStartElement (element, namesp, ob);
1371                         }
1372
1373                         if (needType) WriteXsiType("Import", "http://schemas.xmlsoap.org/wsdl/");
1374
1375                         WriteAttribute ("namespace", "", ob.Namespace);
1376                         WriteAttribute ("location", "", ob.Location);
1377
1378                         if (ob.Documentation != "") {
1379                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1380                         }
1381                         if (writeWrappingElem) WriteEndElement (ob);
1382                 }
1383
1384                 void WriteObject_Types (System.Web.Services.Description.Types ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1385                 {
1386                         if (ob == null)
1387                         {
1388                                 if (isNullable)
1389                                         WriteNullTagLiteral(element, namesp);
1390                                 return;
1391                         }
1392
1393                         if (writeWrappingElem) {
1394                                 WriteStartElement (element, namesp, ob);
1395                         }
1396
1397                         if (needType) WriteXsiType("Types", "http://schemas.xmlsoap.org/wsdl/");
1398
1399                         ServiceDescription.WriteExtensions (Writer, ob);
1400                         if (ob.Schemas != null) {
1401                                 for (int n64 = 0; n64 < ob.Schemas.Count; n64++) {
1402                                         WriteObject_XmlSchema (ob.Schemas[n64], "schema", "http://www.w3.org/2001/XMLSchema", false, false, true);
1403                                 }
1404                         }
1405                         if (ob.Documentation != "") {
1406                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1407                         }
1408                         if (writeWrappingElem) WriteEndElement (ob);
1409                 }
1410
1411                 void WriteObject_Message (System.Web.Services.Description.Message ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1412                 {
1413                         if (ob == null)
1414                         {
1415                                 if (isNullable)
1416                                         WriteNullTagLiteral(element, namesp);
1417                                 return;
1418                         }
1419
1420                         if (writeWrappingElem) {
1421                                 WriteStartElement (element, namesp, ob);
1422                         }
1423
1424                         if (needType) WriteXsiType("Message", "http://schemas.xmlsoap.org/wsdl/");
1425
1426                         WriteAttribute ("name", "", ob.Name.ToString());
1427
1428                         if (ob.Parts != null) {
1429                                 for (int n65 = 0; n65 < ob.Parts.Count; n65++) {
1430                                         WriteObject_MessagePart (ob.Parts[n65], "part", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1431                                 }
1432                         }
1433                         if (ob.Documentation != "") {
1434                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1435                         }
1436                         if (writeWrappingElem) WriteEndElement (ob);
1437                 }
1438
1439                 void WriteObject_PortType (System.Web.Services.Description.PortType ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1440                 {
1441                         if (ob == null)
1442                         {
1443                                 if (isNullable)
1444                                         WriteNullTagLiteral(element, namesp);
1445                                 return;
1446                         }
1447
1448                         if (writeWrappingElem) {
1449                                 WriteStartElement (element, namesp, ob);
1450                         }
1451
1452                         if (needType) WriteXsiType("PortType", "http://schemas.xmlsoap.org/wsdl/");
1453
1454                         WriteAttribute ("name", "", ob.Name.ToString());
1455
1456                         if (ob.Operations != null) {
1457                                 for (int n66 = 0; n66 < ob.Operations.Count; n66++) {
1458                                         WriteObject_Operation (ob.Operations[n66], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1459                                 }
1460                         }
1461                         if (ob.Documentation != "") {
1462                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1463                         }
1464                         if (writeWrappingElem) WriteEndElement (ob);
1465                 }
1466
1467                 void WriteObject_Binding (System.Web.Services.Description.Binding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1468                 {
1469                         if (ob == null)
1470                         {
1471                                 if (isNullable)
1472                                         WriteNullTagLiteral(element, namesp);
1473                                 return;
1474                         }
1475
1476                         if (writeWrappingElem) {
1477                                 WriteStartElement (element, namesp, ob);
1478                         }
1479
1480                         if (needType) WriteXsiType("Binding", "http://schemas.xmlsoap.org/wsdl/");
1481
1482                         WriteAttribute ("name", "", ob.Name.ToString());
1483                         WriteAttribute ("type", "", FromXmlQualifiedName (ob.Type));
1484
1485                         ServiceDescription.WriteExtensions (Writer, ob);
1486                         if (ob.Operations != null) {
1487                                 for (int n67 = 0; n67 < ob.Operations.Count; n67++) {
1488                                         WriteObject_OperationBinding (ob.Operations[n67], "operation", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1489                                 }
1490                         }
1491                         if (ob.Documentation != "") {
1492                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1493                         }
1494                         if (writeWrappingElem) WriteEndElement (ob);
1495                 }
1496
1497                 void WriteObject_Service (System.Web.Services.Description.Service ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1498                 {
1499                         if (ob == null)
1500                         {
1501                                 if (isNullable)
1502                                         WriteNullTagLiteral(element, namesp);
1503                                 return;
1504                         }
1505
1506                         if (writeWrappingElem) {
1507                                 WriteStartElement (element, namesp, ob);
1508                         }
1509
1510                         if (needType) WriteXsiType("Service", "http://schemas.xmlsoap.org/wsdl/");
1511
1512                         WriteAttribute ("name", "", ob.Name.ToString());
1513
1514                         if (ob.Ports != null) {
1515                                 for (int n68 = 0; n68 < ob.Ports.Count; n68++) {
1516                                         WriteObject_Port (ob.Ports[n68], "port", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1517                                 }
1518                         }
1519                         if (ob.Documentation != "") {
1520                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1521                         }
1522                         if (writeWrappingElem) WriteEndElement (ob);
1523                 }
1524
1525                 void WriteObject_XmlSchema (System.Xml.Schema.XmlSchema ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1526                 {
1527                         ob.Write (Writer);
1528                 }
1529
1530                 void WriteObject_MessagePart (System.Web.Services.Description.MessagePart ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1531                 {
1532                         if (ob == null)
1533                         {
1534                                 if (isNullable)
1535                                         WriteNullTagLiteral(element, namesp);
1536                                 return;
1537                         }
1538
1539                         if (writeWrappingElem) {
1540                                 WriteStartElement (element, namesp, ob);
1541                         }
1542
1543                         if (needType) WriteXsiType("MessagePart", "http://schemas.xmlsoap.org/wsdl/");
1544
1545                         WriteAttribute ("name", "", ob.Name.ToString());
1546                         WriteAttribute ("element", "", FromXmlQualifiedName (ob.Element));
1547                         WriteAttribute ("type", "", FromXmlQualifiedName (ob.Type));
1548
1549                         if (ob.Documentation != "") {
1550                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1551                         }
1552                         if (writeWrappingElem) WriteEndElement (ob);
1553                 }
1554
1555                 void WriteObject_Operation (System.Web.Services.Description.Operation ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1556                 {
1557                         if (ob == null)
1558                         {
1559                                 if (isNullable)
1560                                         WriteNullTagLiteral(element, namesp);
1561                                 return;
1562                         }
1563
1564                         if (writeWrappingElem) {
1565                                 WriteStartElement (element, namesp, ob);
1566                         }
1567
1568                         if (needType) WriteXsiType("Operation", "http://schemas.xmlsoap.org/wsdl/");
1569
1570                         WriteAttribute ("name", "", ob.Name.ToString());
1571                         if (ob.ParameterOrderString != "") {
1572                                 WriteAttribute ("parameterOrder", "", ob.ParameterOrderString);
1573                         }
1574
1575                         if (ob.Faults != null) {
1576                                 for (int n69 = 0; n69 < ob.Faults.Count; n69++) {
1577                                         WriteObject_OperationFault (ob.Faults[n69], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1578                                 }
1579                         }
1580                         if (ob.Messages != null) {
1581                                 for (int n70 = 0; n70 < ob.Messages.Count; n70++) {
1582                                         if (ob.Messages[n70] is System.Web.Services.Description.OperationInput) {
1583                                                 WriteObject_OperationInput (((System.Web.Services.Description.OperationInput) ob.Messages[n70]), "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1584                                         }
1585                                         else if (ob.Messages[n70] is System.Web.Services.Description.OperationOutput) {
1586                                                 WriteObject_OperationOutput (((System.Web.Services.Description.OperationOutput) ob.Messages[n70]), "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1587                                         }
1588                                         else if (ob.Messages[n70] != null) throw CreateUnknownTypeException (ob.Messages[n70]);
1589                                 }
1590                         }
1591                         if (ob.Documentation != "") {
1592                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1593                         }
1594                         if (writeWrappingElem) WriteEndElement (ob);
1595                 }
1596
1597                 void WriteObject_OperationBinding (System.Web.Services.Description.OperationBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1598                 {
1599                         if (ob == null)
1600                         {
1601                                 if (isNullable)
1602                                         WriteNullTagLiteral(element, namesp);
1603                                 return;
1604                         }
1605
1606                         if (writeWrappingElem) {
1607                                 WriteStartElement (element, namesp, ob);
1608                         }
1609
1610                         if (needType) WriteXsiType("OperationBinding", "http://schemas.xmlsoap.org/wsdl/");
1611
1612                         WriteAttribute ("name", "", ob.Name.ToString());
1613
1614                         ServiceDescription.WriteExtensions (Writer, ob);
1615                         if (ob.Faults != null) {
1616                                 for (int n71 = 0; n71 < ob.Faults.Count; n71++) {
1617                                         WriteObject_FaultBinding (ob.Faults[n71], "fault", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1618                                 }
1619                         }
1620                         WriteObject_InputBinding (ob.Input, "input", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1621                         WriteObject_OutputBinding (ob.Output, "output", "http://schemas.xmlsoap.org/wsdl/", false, false, true);
1622                         if (ob.Documentation != "") {
1623                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1624                         }
1625                         if (writeWrappingElem) WriteEndElement (ob);
1626                 }
1627
1628                 void WriteObject_Port (System.Web.Services.Description.Port ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1629                 {
1630                         if (ob == null)
1631                         {
1632                                 if (isNullable)
1633                                         WriteNullTagLiteral(element, namesp);
1634                                 return;
1635                         }
1636
1637                         if (writeWrappingElem) {
1638                                 WriteStartElement (element, namesp, ob);
1639                         }
1640
1641                         if (needType) WriteXsiType("Port", "http://schemas.xmlsoap.org/wsdl/");
1642
1643                         WriteAttribute ("name", "", ob.Name.ToString());
1644                         WriteAttribute ("binding", "", FromXmlQualifiedName (ob.Binding));
1645
1646                         ServiceDescription.WriteExtensions (Writer, ob);
1647                         if (ob.Documentation != "") {
1648                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1649                         }
1650                         if (writeWrappingElem) WriteEndElement (ob);
1651                 }
1652
1653                 void WriteObject_OperationFault (System.Web.Services.Description.OperationFault ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1654                 {
1655                         if (ob == null)
1656                         {
1657                                 if (isNullable)
1658                                         WriteNullTagLiteral(element, namesp);
1659                                 return;
1660                         }
1661
1662                         if (writeWrappingElem) {
1663                                 WriteStartElement (element, namesp, ob);
1664                         }
1665
1666                         if (needType) WriteXsiType("OperationFault", "http://schemas.xmlsoap.org/wsdl/");
1667
1668                         if (ob.Name != "") {
1669                                 WriteAttribute ("name", "", ob.Name.ToString());
1670                         }
1671                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.Message));
1672
1673                         if (ob.Documentation != "") {
1674                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1675                         }
1676                         if (writeWrappingElem) WriteEndElement (ob);
1677                 }
1678
1679                 void WriteObject_OperationInput (System.Web.Services.Description.OperationInput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1680                 {
1681                         if (ob == null)
1682                         {
1683                                 if (isNullable)
1684                                         WriteNullTagLiteral(element, namesp);
1685                                 return;
1686                         }
1687
1688                         if (writeWrappingElem) {
1689                                 WriteStartElement (element, namesp, ob);
1690                         }
1691
1692                         if (needType) WriteXsiType("OperationInput", "http://schemas.xmlsoap.org/wsdl/");
1693
1694                         if (ob.Name != "") {
1695                                 WriteAttribute ("name", "", ob.Name.ToString());
1696                         }
1697                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.Message));
1698
1699                         if (ob.Documentation != "") {
1700                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1701                         }
1702                         if (writeWrappingElem) WriteEndElement (ob);
1703                 }
1704
1705                 void WriteObject_OperationOutput (System.Web.Services.Description.OperationOutput ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1706                 {
1707                         if (ob == null)
1708                         {
1709                                 if (isNullable)
1710                                         WriteNullTagLiteral(element, namesp);
1711                                 return;
1712                         }
1713
1714                         if (writeWrappingElem) {
1715                                 WriteStartElement (element, namesp, ob);
1716                         }
1717
1718                         if (needType) WriteXsiType("OperationOutput", "http://schemas.xmlsoap.org/wsdl/");
1719
1720                         if (ob.Name != "") {
1721                                 WriteAttribute ("name", "", ob.Name.ToString());
1722                         }
1723                         WriteAttribute ("message", "", FromXmlQualifiedName (ob.Message));
1724
1725                         if (ob.Documentation != "") {
1726                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1727                         }
1728                         if (writeWrappingElem) WriteEndElement (ob);
1729                 }
1730
1731                 void WriteObject_FaultBinding (System.Web.Services.Description.FaultBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1732                 {
1733                         if (ob == null)
1734                         {
1735                                 if (isNullable)
1736                                         WriteNullTagLiteral(element, namesp);
1737                                 return;
1738                         }
1739
1740                         if (writeWrappingElem) {
1741                                 WriteStartElement (element, namesp, ob);
1742                         }
1743
1744                         if (needType) WriteXsiType("FaultBinding", "http://schemas.xmlsoap.org/wsdl/");
1745
1746                         if (ob.Name != "") {
1747                                 WriteAttribute ("name", "", ob.Name.ToString());
1748                         }
1749
1750                         ServiceDescription.WriteExtensions (Writer, ob);
1751                         if (ob.Documentation != "") {
1752                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1753                         }
1754                         if (writeWrappingElem) WriteEndElement (ob);
1755                 }
1756
1757                 void WriteObject_InputBinding (System.Web.Services.Description.InputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1758                 {
1759                         if (ob == null)
1760                         {
1761                                 if (isNullable)
1762                                         WriteNullTagLiteral(element, namesp);
1763                                 return;
1764                         }
1765
1766                         if (writeWrappingElem) {
1767                                 WriteStartElement (element, namesp, ob);
1768                         }
1769
1770                         if (needType) WriteXsiType("InputBinding", "http://schemas.xmlsoap.org/wsdl/");
1771
1772                         if (ob.Name != "") {
1773                                 WriteAttribute ("name", "", ob.Name.ToString());
1774                         }
1775
1776                         ServiceDescription.WriteExtensions (Writer, ob);
1777                         if (ob.Documentation != "") {
1778                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1779                         }
1780                         if (writeWrappingElem) WriteEndElement (ob);
1781                 }
1782
1783                 void WriteObject_OutputBinding (System.Web.Services.Description.OutputBinding ob, string element, string namesp, bool isNullable, bool needType, bool writeWrappingElem)
1784                 {
1785                         if (ob == null)
1786                         {
1787                                 if (isNullable)
1788                                         WriteNullTagLiteral(element, namesp);
1789                                 return;
1790                         }
1791
1792                         if (writeWrappingElem) {
1793                                 WriteStartElement (element, namesp, ob);
1794                         }
1795
1796                         if (needType) WriteXsiType("OutputBinding", "http://schemas.xmlsoap.org/wsdl/");
1797
1798                         if (ob.Name != "") {
1799                                 WriteAttribute ("name", "", ob.Name.ToString());
1800                         }
1801
1802                         ServiceDescription.WriteExtensions (Writer, ob);
1803                         if (ob.Documentation != "") {
1804                                 WriteElementString ("documentation", "http://schemas.xmlsoap.org/wsdl/", ob.Documentation);
1805                         }
1806                         if (writeWrappingElem) WriteEndElement (ob);
1807                 }
1808
1809                 protected override void InitCallbacks ()
1810                 {
1811                 }
1812
1813         }
1814 }