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