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