1 namespace System.Web.Services.Discovery { 2 internal class DiscoveryDocumentSerializationWriter : System.Xml.Serialization.XmlSerializationWriter { 3 4 Write10_discovery(object o)5 public void Write10_discovery(object o) { 6 WriteStartDocument(); 7 if (o == null) { 8 WriteNullTagLiteral(@"discovery", @"http://schemas.xmlsoap.org/disco/"); 9 return; 10 } 11 TopLevelElement(); 12 Write9_DiscoveryDocument(@"discovery", @"http://schemas.xmlsoap.org/disco/", ((global::System.Web.Services.Discovery.DiscoveryDocument)o), true, false); 13 } 14 Write9_DiscoveryDocument(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocument o, bool isNullable, bool needType)15 void Write9_DiscoveryDocument(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocument o, bool isNullable, bool needType) { 16 if ((object)o == null) { 17 if (isNullable) WriteNullTagLiteral(n, ns); 18 return; 19 } 20 if (!needType) { 21 System.Type t = o.GetType(); 22 if (t == typeof(global::System.Web.Services.Discovery.DiscoveryDocument)) { 23 } 24 else { 25 throw CreateUnknownTypeException(o); 26 } 27 } 28 WriteStartElement(n, ns, o, false, null); 29 if (needType) WriteXsiType(@"DiscoveryDocument", @"http://schemas.xmlsoap.org/disco/"); 30 { 31 global::System.Collections.IList a = (global::System.Collections.IList)o.@References; 32 if (a != null) { 33 for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) { 34 global::System.Object ai = (global::System.Object)a[ia]; 35 { 36 if (ai is global::System.Web.Services.Discovery.SchemaReference) { 37 Write7_SchemaReference(@"schemaRef", @"http://schemas.xmlsoap.org/disco/schema/", ((global::System.Web.Services.Discovery.SchemaReference)ai), false, false); 38 } 39 else if (ai is global::System.Web.Services.Discovery.ContractReference) { 40 Write5_ContractReference(@"contractRef", @"http://schemas.xmlsoap.org/disco/scl/", ((global::System.Web.Services.Discovery.ContractReference)ai), false, false); 41 } 42 else if (ai is global::System.Web.Services.Discovery.DiscoveryDocumentReference) { 43 Write3_DiscoveryDocumentReference(@"discoveryRef", @"http://schemas.xmlsoap.org/disco/", ((global::System.Web.Services.Discovery.DiscoveryDocumentReference)ai), false, false); 44 } 45 else if (ai is global::System.Web.Services.Discovery.SoapBinding) { 46 Write8_SoapBinding(@"soap", @"http://schemas.xmlsoap.org/disco/soap/", ((global::System.Web.Services.Discovery.SoapBinding)ai), false, false); 47 } 48 else { 49 if (ai != null) { 50 throw CreateUnknownTypeException(ai); 51 } 52 } 53 } 54 } 55 } 56 } 57 WriteEndElement(o); 58 } 59 Write8_SoapBinding(string n, string ns, global::System.Web.Services.Discovery.SoapBinding o, bool isNullable, bool needType)60 void Write8_SoapBinding(string n, string ns, global::System.Web.Services.Discovery.SoapBinding o, bool isNullable, bool needType) { 61 if ((object)o == null) { 62 if (isNullable) WriteNullTagLiteral(n, ns); 63 return; 64 } 65 if (!needType) { 66 System.Type t = o.GetType(); 67 if (t == typeof(global::System.Web.Services.Discovery.SoapBinding)) { 68 } 69 else { 70 throw CreateUnknownTypeException(o); 71 } 72 } 73 WriteStartElement(n, ns, o, false, null); 74 if (needType) WriteXsiType(@"SoapBinding", @"http://schemas.xmlsoap.org/disco/soap/"); 75 WriteAttribute(@"address", @"", ((global::System.String)o.@Address)); 76 WriteAttribute(@"binding", @"", FromXmlQualifiedName(((global::System.Xml.XmlQualifiedName)o.@Binding))); 77 WriteEndElement(o); 78 } 79 Write3_DiscoveryDocumentReference(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocumentReference o, bool isNullable, bool needType)80 void Write3_DiscoveryDocumentReference(string n, string ns, global::System.Web.Services.Discovery.DiscoveryDocumentReference o, bool isNullable, bool needType) { 81 if ((object)o == null) { 82 if (isNullable) WriteNullTagLiteral(n, ns); 83 return; 84 } 85 if (!needType) { 86 System.Type t = o.GetType(); 87 if (t == typeof(global::System.Web.Services.Discovery.DiscoveryDocumentReference)) { 88 } 89 else { 90 throw CreateUnknownTypeException(o); 91 } 92 } 93 WriteStartElement(n, ns, o, false, null); 94 if (needType) WriteXsiType(@"DiscoveryDocumentReference", @"http://schemas.xmlsoap.org/disco/"); 95 WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref)); 96 WriteEndElement(o); 97 } 98 Write5_ContractReference(string n, string ns, global::System.Web.Services.Discovery.ContractReference o, bool isNullable, bool needType)99 void Write5_ContractReference(string n, string ns, global::System.Web.Services.Discovery.ContractReference o, bool isNullable, bool needType) { 100 if ((object)o == null) { 101 if (isNullable) WriteNullTagLiteral(n, ns); 102 return; 103 } 104 if (!needType) { 105 System.Type t = o.GetType(); 106 if (t == typeof(global::System.Web.Services.Discovery.ContractReference)) { 107 } 108 else { 109 throw CreateUnknownTypeException(o); 110 } 111 } 112 WriteStartElement(n, ns, o, false, null); 113 if (needType) WriteXsiType(@"ContractReference", @"http://schemas.xmlsoap.org/disco/scl/"); 114 WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref)); 115 WriteAttribute(@"docRef", @"", ((global::System.String)o.@DocRef)); 116 WriteEndElement(o); 117 } 118 Write7_SchemaReference(string n, string ns, global::System.Web.Services.Discovery.SchemaReference o, bool isNullable, bool needType)119 void Write7_SchemaReference(string n, string ns, global::System.Web.Services.Discovery.SchemaReference o, bool isNullable, bool needType) { 120 if ((object)o == null) { 121 if (isNullable) WriteNullTagLiteral(n, ns); 122 return; 123 } 124 if (!needType) { 125 System.Type t = o.GetType(); 126 if (t == typeof(global::System.Web.Services.Discovery.SchemaReference)) { 127 } 128 else { 129 throw CreateUnknownTypeException(o); 130 } 131 } 132 WriteStartElement(n, ns, o, false, null); 133 if (needType) WriteXsiType(@"SchemaReference", @"http://schemas.xmlsoap.org/disco/schema/"); 134 WriteAttribute(@"ref", @"", ((global::System.String)o.@Ref)); 135 WriteAttribute(@"targetNamespace", @"", ((global::System.String)o.@TargetNamespace)); 136 WriteEndElement(o); 137 } 138 InitCallbacks()139 protected override void InitCallbacks() { 140 } 141 } 142 internal class DiscoveryDocumentSerializationReader : System.Xml.Serialization.XmlSerializationReader { 143 144 Read10_discovery()145 public object Read10_discovery() { 146 object o = null; 147 Reader.MoveToContent(); 148 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 149 if (((object) Reader.LocalName == (object)id1_discovery && (object) Reader.NamespaceURI == (object)id2_Item)) { 150 o = Read9_DiscoveryDocument(true, true); 151 } 152 else { 153 throw CreateUnknownNodeException(); 154 } 155 } 156 else { 157 UnknownNode(null, @"http://schemas.xmlsoap.org/disco/:discovery"); 158 } 159 return (object)o; 160 } 161 Read9_DiscoveryDocument(bool isNullable, bool checkType)162 global::System.Web.Services.Discovery.DiscoveryDocument Read9_DiscoveryDocument(bool isNullable, bool checkType) { 163 System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null; 164 bool isNull = false; 165 if (isNullable) isNull = ReadNull(); 166 if (checkType) { 167 if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id3_DiscoveryDocument && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { 168 } 169 else 170 throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 171 } 172 if (isNull) return null; 173 global::System.Web.Services.Discovery.DiscoveryDocument o; 174 o = new global::System.Web.Services.Discovery.DiscoveryDocument(); 175 global::System.Collections.IList a_0 = (global::System.Collections.IList)o.@References; 176 bool[] paramsRead = new bool[1]; 177 while (Reader.MoveToNextAttribute()) { 178 if (!IsXmlnsAttribute(Reader.Name)) { 179 UnknownNode((object)o); 180 } 181 } 182 Reader.MoveToElement(); 183 if (Reader.IsEmptyElement) { 184 Reader.Skip(); 185 return o; 186 } 187 Reader.ReadStartElement(); 188 Reader.MoveToContent(); 189 int whileIterations0 = 0; 190 int readerCount0 = ReaderCount; 191 while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 192 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 193 if (((object) Reader.LocalName == (object)id4_discoveryRef && (object) Reader.NamespaceURI == (object)id2_Item)) { 194 if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read3_DiscoveryDocumentReference(false, true)); 195 } 196 else if (((object) Reader.LocalName == (object)id5_contractRef && (object) Reader.NamespaceURI == (object)id6_Item)) { 197 if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read5_ContractReference(false, true)); 198 } 199 else if (((object) Reader.LocalName == (object)id7_schemaRef && (object) Reader.NamespaceURI == (object)id8_Item)) { 200 if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read7_SchemaReference(false, true)); 201 } 202 else if (((object) Reader.LocalName == (object)id9_soap && (object) Reader.NamespaceURI == (object)id10_Item)) { 203 if ((object)(a_0) == null) Reader.Skip(); else a_0.Add(Read8_SoapBinding(false, true)); 204 } 205 else { 206 UnknownNode((object)o, @"http://schemas.xmlsoap.org/disco/:discoveryRef, http://schemas.xmlsoap.org/disco/scl/:contractRef, http://schemas.xmlsoap.org/disco/schema/:schemaRef, http://schemas.xmlsoap.org/disco/soap/:soap"); 207 } 208 } 209 else { 210 UnknownNode((object)o, @"http://schemas.xmlsoap.org/disco/:discoveryRef, http://schemas.xmlsoap.org/disco/scl/:contractRef, http://schemas.xmlsoap.org/disco/schema/:schemaRef, http://schemas.xmlsoap.org/disco/soap/:soap"); 211 } 212 Reader.MoveToContent(); 213 CheckReaderCount(ref whileIterations0, ref readerCount0); 214 } 215 ReadEndElement(); 216 return o; 217 } 218 Read8_SoapBinding(bool isNullable, bool checkType)219 global::System.Web.Services.Discovery.SoapBinding Read8_SoapBinding(bool isNullable, bool checkType) { 220 System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null; 221 bool isNull = false; 222 if (isNullable) isNull = ReadNull(); 223 if (checkType) { 224 if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id11_SoapBinding && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id10_Item)) { 225 } 226 else 227 throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 228 } 229 if (isNull) return null; 230 global::System.Web.Services.Discovery.SoapBinding o; 231 o = new global::System.Web.Services.Discovery.SoapBinding(); 232 bool[] paramsRead = new bool[2]; 233 while (Reader.MoveToNextAttribute()) { 234 if (!paramsRead[0] && ((object) Reader.LocalName == (object)id12_address && (object) Reader.NamespaceURI == (object)id13_Item)) { 235 o.@Address = Reader.Value; 236 paramsRead[0] = true; 237 } 238 else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id14_binding && (object) Reader.NamespaceURI == (object)id13_Item)) { 239 o.@Binding = ToXmlQualifiedName(Reader.Value); 240 paramsRead[1] = true; 241 } 242 else if (!IsXmlnsAttribute(Reader.Name)) { 243 UnknownNode((object)o, @":address, :binding"); 244 } 245 } 246 Reader.MoveToElement(); 247 if (Reader.IsEmptyElement) { 248 Reader.Skip(); 249 return o; 250 } 251 Reader.ReadStartElement(); 252 Reader.MoveToContent(); 253 int whileIterations1 = 0; 254 int readerCount1 = ReaderCount; 255 while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 256 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 257 UnknownNode((object)o, @""); 258 } 259 else { 260 UnknownNode((object)o, @""); 261 } 262 Reader.MoveToContent(); 263 CheckReaderCount(ref whileIterations1, ref readerCount1); 264 } 265 ReadEndElement(); 266 return o; 267 } 268 Read7_SchemaReference(bool isNullable, bool checkType)269 global::System.Web.Services.Discovery.SchemaReference Read7_SchemaReference(bool isNullable, bool checkType) { 270 System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null; 271 bool isNull = false; 272 if (isNullable) isNull = ReadNull(); 273 if (checkType) { 274 if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id15_SchemaReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id8_Item)) { 275 } 276 else 277 throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 278 } 279 if (isNull) return null; 280 global::System.Web.Services.Discovery.SchemaReference o; 281 o = new global::System.Web.Services.Discovery.SchemaReference(); 282 bool[] paramsRead = new bool[2]; 283 while (Reader.MoveToNextAttribute()) { 284 if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) { 285 o.@Ref = Reader.Value; 286 paramsRead[0] = true; 287 } 288 else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id17_targetNamespace && (object) Reader.NamespaceURI == (object)id13_Item)) { 289 o.@TargetNamespace = Reader.Value; 290 paramsRead[1] = true; 291 } 292 else if (!IsXmlnsAttribute(Reader.Name)) { 293 UnknownNode((object)o, @":ref, :targetNamespace"); 294 } 295 } 296 Reader.MoveToElement(); 297 if (Reader.IsEmptyElement) { 298 Reader.Skip(); 299 return o; 300 } 301 Reader.ReadStartElement(); 302 Reader.MoveToContent(); 303 int whileIterations2 = 0; 304 int readerCount2 = ReaderCount; 305 while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 306 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 307 UnknownNode((object)o, @""); 308 } 309 else { 310 UnknownNode((object)o, @""); 311 } 312 Reader.MoveToContent(); 313 CheckReaderCount(ref whileIterations2, ref readerCount2); 314 } 315 ReadEndElement(); 316 return o; 317 } 318 Read5_ContractReference(bool isNullable, bool checkType)319 global::System.Web.Services.Discovery.ContractReference Read5_ContractReference(bool isNullable, bool checkType) { 320 System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null; 321 bool isNull = false; 322 if (isNullable) isNull = ReadNull(); 323 if (checkType) { 324 if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id18_ContractReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id6_Item)) { 325 } 326 else 327 throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 328 } 329 if (isNull) return null; 330 global::System.Web.Services.Discovery.ContractReference o; 331 o = new global::System.Web.Services.Discovery.ContractReference(); 332 bool[] paramsRead = new bool[2]; 333 while (Reader.MoveToNextAttribute()) { 334 if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) { 335 o.@Ref = Reader.Value; 336 paramsRead[0] = true; 337 } 338 else if (!paramsRead[1] && ((object) Reader.LocalName == (object)id19_docRef && (object) Reader.NamespaceURI == (object)id13_Item)) { 339 o.@DocRef = Reader.Value; 340 paramsRead[1] = true; 341 } 342 else if (!IsXmlnsAttribute(Reader.Name)) { 343 UnknownNode((object)o, @":ref, :docRef"); 344 } 345 } 346 Reader.MoveToElement(); 347 if (Reader.IsEmptyElement) { 348 Reader.Skip(); 349 return o; 350 } 351 Reader.ReadStartElement(); 352 Reader.MoveToContent(); 353 int whileIterations3 = 0; 354 int readerCount3 = ReaderCount; 355 while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 356 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 357 UnknownNode((object)o, @""); 358 } 359 else { 360 UnknownNode((object)o, @""); 361 } 362 Reader.MoveToContent(); 363 CheckReaderCount(ref whileIterations3, ref readerCount3); 364 } 365 ReadEndElement(); 366 return o; 367 } 368 Read3_DiscoveryDocumentReference(bool isNullable, bool checkType)369 global::System.Web.Services.Discovery.DiscoveryDocumentReference Read3_DiscoveryDocumentReference(bool isNullable, bool checkType) { 370 System.Xml.XmlQualifiedName xsiType = checkType ? GetXsiType() : null; 371 bool isNull = false; 372 if (isNullable) isNull = ReadNull(); 373 if (checkType) { 374 if (xsiType == null || ((object) ((System.Xml.XmlQualifiedName)xsiType).Name == (object)id20_DiscoveryDocumentReference && (object) ((System.Xml.XmlQualifiedName)xsiType).Namespace == (object)id2_Item)) { 375 } 376 else 377 throw CreateUnknownTypeException((System.Xml.XmlQualifiedName)xsiType); 378 } 379 if (isNull) return null; 380 global::System.Web.Services.Discovery.DiscoveryDocumentReference o; 381 o = new global::System.Web.Services.Discovery.DiscoveryDocumentReference(); 382 bool[] paramsRead = new bool[1]; 383 while (Reader.MoveToNextAttribute()) { 384 if (!paramsRead[0] && ((object) Reader.LocalName == (object)id16_ref && (object) Reader.NamespaceURI == (object)id13_Item)) { 385 o.@Ref = Reader.Value; 386 paramsRead[0] = true; 387 } 388 else if (!IsXmlnsAttribute(Reader.Name)) { 389 UnknownNode((object)o, @":ref"); 390 } 391 } 392 Reader.MoveToElement(); 393 if (Reader.IsEmptyElement) { 394 Reader.Skip(); 395 return o; 396 } 397 Reader.ReadStartElement(); 398 Reader.MoveToContent(); 399 int whileIterations4 = 0; 400 int readerCount4 = ReaderCount; 401 while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) { 402 if (Reader.NodeType == System.Xml.XmlNodeType.Element) { 403 UnknownNode((object)o, @""); 404 } 405 else { 406 UnknownNode((object)o, @""); 407 } 408 Reader.MoveToContent(); 409 CheckReaderCount(ref whileIterations4, ref readerCount4); 410 } 411 ReadEndElement(); 412 return o; 413 } 414 InitCallbacks()415 protected override void InitCallbacks() { 416 } 417 418 string id1_discovery; 419 string id4_discoveryRef; 420 string id19_docRef; 421 string id8_Item; 422 string id14_binding; 423 string id20_DiscoveryDocumentReference; 424 string id17_targetNamespace; 425 string id5_contractRef; 426 string id10_Item; 427 string id13_Item; 428 string id7_schemaRef; 429 string id3_DiscoveryDocument; 430 string id9_soap; 431 string id12_address; 432 string id16_ref; 433 string id11_SoapBinding; 434 string id18_ContractReference; 435 string id2_Item; 436 string id15_SchemaReference; 437 string id6_Item; 438 InitIDs()439 protected override void InitIDs() { 440 id1_discovery = Reader.NameTable.Add(@"discovery"); 441 id4_discoveryRef = Reader.NameTable.Add(@"discoveryRef"); 442 id19_docRef = Reader.NameTable.Add(@"docRef"); 443 id8_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/schema/"); 444 id14_binding = Reader.NameTable.Add(@"binding"); 445 id20_DiscoveryDocumentReference = Reader.NameTable.Add(@"DiscoveryDocumentReference"); 446 id17_targetNamespace = Reader.NameTable.Add(@"targetNamespace"); 447 id5_contractRef = Reader.NameTable.Add(@"contractRef"); 448 id10_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/soap/"); 449 id13_Item = Reader.NameTable.Add(@""); 450 id7_schemaRef = Reader.NameTable.Add(@"schemaRef"); 451 id3_DiscoveryDocument = Reader.NameTable.Add(@"DiscoveryDocument"); 452 id9_soap = Reader.NameTable.Add(@"soap"); 453 id12_address = Reader.NameTable.Add(@"address"); 454 id16_ref = Reader.NameTable.Add(@"ref"); 455 id11_SoapBinding = Reader.NameTable.Add(@"SoapBinding"); 456 id18_ContractReference = Reader.NameTable.Add(@"ContractReference"); 457 id2_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/"); 458 id15_SchemaReference = Reader.NameTable.Add(@"SchemaReference"); 459 id6_Item = Reader.NameTable.Add(@"http://schemas.xmlsoap.org/disco/scl/"); 460 } 461 } 462 } 463