1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
|
//------------------------------------------------------------------------------
// <copyright file="ServiceDescriptionImporter.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Web.Services.Description {
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.Xml.Schema;
using System.Collections;
using System.Collections.Specialized;
using System.Collections.Generic;
using System;
using System.Reflection;
using System.CodeDom.Compiler;
using System.Web.Services.Configuration;
using System.Xml;
using System.CodeDom;
using System.Globalization;
using System.Security.Permissions;
using System.Runtime.InteropServices;
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[Flags]
public enum ServiceDescriptionImportWarnings {
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.NoCodeGenerated"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
NoCodeGenerated = 0x1,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.OptionalExtensionsIgnored"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
OptionalExtensionsIgnored = 0x2,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.RequiredExtensionsIgnored"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
RequiredExtensionsIgnored = 0x4,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.UnsupportedOperationsIgnored"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
UnsupportedOperationsIgnored = 0x8,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.UnsupportedBindingsIgnored"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
UnsupportedBindingsIgnored = 0x10,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.NoMethodsGenerated"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
NoMethodsGenerated = 0x20,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.SchemaValidation"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
SchemaValidation = 0x40,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportWarnings.WSIConformance"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
WsiConformance = 0x80,
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportStyle"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public enum ServiceDescriptionImportStyle {
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportStyle.Client"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[XmlEnum("client")]
Client,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportStyle.Server"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[XmlEnum("server")]
Server,
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImportStyle.ServerInterface"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[XmlEnum("serverInterface")]
ServerInterface,
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]
[PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")]
public class ServiceDescriptionImporter {
ServiceDescriptionImportStyle style = ServiceDescriptionImportStyle.Client;
ServiceDescriptionCollection serviceDescriptions = new ServiceDescriptionCollection();
XmlSchemas schemas = new XmlSchemas(); // those external to SDLs
XmlSchemas allSchemas = new XmlSchemas(); // all schemas, incl. those inside SDLs
string protocolName;
CodeGenerationOptions options = CodeGenerationOptions.GenerateOldAsync;
CodeCompileUnit codeCompileUnit;
CodeDomProvider codeProvider;
ProtocolImporter[] importers;
XmlSchemas abstractSchemas = new XmlSchemas(); // all schemas containing abstract types
XmlSchemas concreteSchemas = new XmlSchemas(); // all "real" xml schemas
List<Type> extensions;
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.ServiceDescriptionImporter"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public ServiceDescriptionImporter() {
Type[] importerTypes = WebServicesSection.Current.ProtocolImporterTypes;
importers = new ProtocolImporter[importerTypes.Length];
for (int i = 0; i < importers.Length; i++) {
importers[i] = (ProtocolImporter)Activator.CreateInstance(importerTypes[i]);
importers[i].Initialize(this);
}
}
internal ServiceDescriptionImporter(CodeCompileUnit codeCompileUnit) : this() {
this.codeCompileUnit = codeCompileUnit;
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.ServiceDescriptions"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public ServiceDescriptionCollection ServiceDescriptions {
get { return serviceDescriptions; }
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.Schemas"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public XmlSchemas Schemas {
get { return schemas; }
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.Style"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public ServiceDescriptionImportStyle Style {
get { return style; }
set { style = value; }
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.CodeGenerationOptions"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[ComVisible(false)]
public CodeGenerationOptions CodeGenerationOptions {
get { return options; }
set { options = value; }
}
internal CodeCompileUnit CodeCompileUnit {
get { return codeCompileUnit; }
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.CodeGenerator"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
[ComVisible(false)]
public CodeDomProvider CodeGenerator {
get {
if (codeProvider == null)
codeProvider = new Microsoft.CSharp.CSharpCodeProvider();
return codeProvider;
}
set { codeProvider = value; }
}
internal List<Type> Extensions {
get {
if (extensions == null) {
extensions = new List<Type>();
}
return extensions;
}
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.ProtocolName"]/*' />
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public String ProtocolName {
get { return protocolName == null ? string.Empty : protocolName; }
set { protocolName = value; }
}
ProtocolImporter FindImporterByName(string protocolName) {
for (int i = 0; i < importers.Length; i++) {
ProtocolImporter importer = importers[i];
if (string.Compare(ProtocolName, importer.ProtocolName, StringComparison.OrdinalIgnoreCase) == 0) {
return importer;
}
}
throw new ArgumentException(Res.GetString(Res.ProtocolWithNameIsNotRecognized1, protocolName), "protocolName");
}
internal XmlSchemas AllSchemas {
get { return allSchemas; }
}
internal XmlSchemas AbstractSchemas {
get { return abstractSchemas; }
}
internal XmlSchemas ConcreteSchemas {
get { return concreteSchemas; }
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.AddServiceDescription"]/*' />
public void AddServiceDescription(ServiceDescription serviceDescription, string appSettingUrlKey, string appSettingBaseUrl) {
if (serviceDescription == null)
throw new ArgumentNullException("serviceDescription");
serviceDescription.AppSettingUrlKey = appSettingUrlKey;
serviceDescription.AppSettingBaseUrl = appSettingBaseUrl;
ServiceDescriptions.Add(serviceDescription);
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.Import"]/*' />
public ServiceDescriptionImportWarnings Import(CodeNamespace codeNamespace, CodeCompileUnit codeCompileUnit) {
if (codeCompileUnit != null) {
codeCompileUnit.ReferencedAssemblies.Add("System.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.Xml.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.Web.Services.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.EnterpriseServices.dll");
}
return Import(codeNamespace, new ImportContext(new CodeIdentifiers(), false), new Hashtable(), new StringCollection());
}
/// <include file='doc\ServiceDescriptionImporter.uex' path='docs/doc[@for="ServiceDescriptionImporter.GenerateWebReferences1"]/*' />
public static StringCollection GenerateWebReferences(WebReferenceCollection webReferences, CodeDomProvider codeProvider, CodeCompileUnit codeCompileUnit, WebReferenceOptions options) {
if (codeCompileUnit != null) {
codeCompileUnit.ReferencedAssemblies.Add("System.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.Xml.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.Web.Services.dll");
codeCompileUnit.ReferencedAssemblies.Add("System.EnterpriseServices.dll");
}
Hashtable namespaces = new Hashtable();
Hashtable exportedMappings = new Hashtable();
foreach (WebReference webReference in webReferences) {
ServiceDescriptionImporter importer = new ServiceDescriptionImporter(codeCompileUnit);
// separate descriptions and schemas
XmlSchemas schemas = new XmlSchemas();
ServiceDescriptionCollection descriptions = new ServiceDescriptionCollection();
foreach (DictionaryEntry entry in webReference.Documents) {
AddDocument((string)entry.Key, entry.Value, schemas, descriptions, webReference.ValidationWarnings);
}
importer.Schemas.Add(schemas);
foreach (ServiceDescription source in descriptions)
importer.AddServiceDescription(source, webReference.AppSettingUrlKey, webReference.AppSettingBaseUrl);
importer.CodeGenerator = codeProvider;
importer.ProtocolName = webReference.ProtocolName;
importer.Style = options.Style;
importer.CodeGenerationOptions = options.CodeGenerationOptions;
foreach (string extensionType in options.SchemaImporterExtensions) {
importer.Extensions.Add(Type.GetType(extensionType, true /*throwOnError*/));
}
ImportContext context = Context(webReference.ProxyCode, namespaces, options.Verbose);
webReference.Warnings = importer.Import(webReference.ProxyCode, context, exportedMappings, webReference.ValidationWarnings);
if (webReference.ValidationWarnings.Count != 0) {
webReference.Warnings |= ServiceDescriptionImportWarnings.SchemaValidation;
}
}
StringCollection shareWarnings = new StringCollection();
if (options.Verbose) {
foreach (ImportContext context in namespaces.Values) {
foreach (string warning in context.Warnings) {
shareWarnings.Add(warning);
}
}
}
return shareWarnings;
}
internal static ImportContext Context(CodeNamespace ns, Hashtable namespaces, bool verbose) {
if (namespaces[ns.Name] == null) {
namespaces[ns.Name] = new ImportContext(new CodeIdentifiers(), true);
}
return (ImportContext)namespaces[ns.Name];
}
internal static void AddDocument(string path, object document, XmlSchemas schemas, ServiceDescriptionCollection descriptions, StringCollection warnings) {
ServiceDescription serviceDescription = document as ServiceDescription;
if (serviceDescription != null) {
descriptions.Add(serviceDescription);
}
else {
XmlSchema schema = document as XmlSchema;
if (schema != null) {
schemas.Add(schema);
}
}
}
private void FindUse(MessagePart part, out bool isEncoded, out bool isLiteral) {
isEncoded = false;
isLiteral = false;
string messageName = part.Message.Name;
Operation associatedOperation = null;
ServiceDescription description = part.Message.ServiceDescription;
foreach (PortType portType in description.PortTypes) {
foreach (Operation operation in portType.Operations) {
foreach (OperationMessage message in operation.Messages) {
if (message.Message.Equals(new XmlQualifiedName(part.Message.Name, description.TargetNamespace))) {
associatedOperation = operation;
FindUse(associatedOperation, description, messageName, ref isEncoded, ref isLiteral);
}
}
}
}
if (associatedOperation == null)
FindUse(null, description, messageName, ref isEncoded, ref isLiteral);
}
private void FindUse(Operation operation, ServiceDescription description, string messageName, ref bool isEncoded, ref bool isLiteral) {
string targetNamespace = description.TargetNamespace;
foreach (Binding binding in description.Bindings) {
if (operation != null && !new XmlQualifiedName(operation.PortType.Name, targetNamespace).Equals(binding.Type))
continue;
foreach (OperationBinding bindingOperation in binding.Operations) {
if (bindingOperation.Input != null) foreach (object extension in bindingOperation.Input.Extensions) {
if (operation != null) {
SoapBodyBinding body = extension as SoapBodyBinding;
if (body != null && operation.IsBoundBy(bindingOperation)) {
if (body.Use == SoapBindingUse.Encoded)
isEncoded = true;
else if (body.Use == SoapBindingUse.Literal)
isLiteral = true;
}
}
else {
SoapHeaderBinding header = extension as SoapHeaderBinding;
if (header != null && header.Message.Name == messageName) {
if (header.Use == SoapBindingUse.Encoded)
isEncoded = true;
else if (header.Use == SoapBindingUse.Literal)
isLiteral = true;
}
}
}
if (bindingOperation.Output != null) foreach (object extension in bindingOperation.Output.Extensions) {
if (operation != null) {
if (operation.IsBoundBy(bindingOperation)) {
SoapBodyBinding body = extension as SoapBodyBinding;
if (body != null) {
if (body.Use == SoapBindingUse.Encoded)
isEncoded = true;
else if (body.Use == SoapBindingUse.Literal)
isLiteral = true;
}
else if (extension is MimeXmlBinding)
isLiteral = true;
}
}
else {
SoapHeaderBinding header = extension as SoapHeaderBinding;
if (header != null && header.Message.Name == messageName) {
if (header.Use == SoapBindingUse.Encoded)
isEncoded = true;
else if (header.Use == SoapBindingUse.Literal)
isLiteral = true;
}
}
}
}
}
}
private void AddImport(XmlSchema schema, Hashtable imports) {
if (schema == null || imports[schema] != null)
return;
imports.Add(schema, schema);
foreach (XmlSchemaExternal external in schema.Includes) {
if (external is XmlSchemaImport) {
XmlSchemaImport import = (XmlSchemaImport)external;
foreach (XmlSchema s in allSchemas.GetSchemas(import.Namespace)) {
AddImport(s, imports);
}
}
}
}
private ServiceDescriptionImportWarnings Import(CodeNamespace codeNamespace, ImportContext importContext, Hashtable exportContext, StringCollection warnings) {
allSchemas = new XmlSchemas();
foreach (XmlSchema schema in schemas) {
allSchemas.Add(schema);
}
foreach (ServiceDescription description in serviceDescriptions) {
foreach (XmlSchema schema in description.Types.Schemas) {
allSchemas.Add(schema);
}
}
Hashtable references = new Hashtable();
if (!allSchemas.Contains(ServiceDescription.Namespace)) {
allSchemas.AddReference(ServiceDescription.Schema);
references[ServiceDescription.Schema] = ServiceDescription.Schema;
}
if (!allSchemas.Contains(Soap.Encoding)) {
allSchemas.AddReference(ServiceDescription.SoapEncodingSchema);
references[ServiceDescription.SoapEncodingSchema] = ServiceDescription.SoapEncodingSchema;
}
allSchemas.Compile(null, false);
// Segregate the schemas containing abstract types from those
// containing regular XML definitions. This is important because
// when you import something returning the ur-type (object), then
// you need to import ALL types/elements within ALL schemas. We
// don't want the RPC-based types leaking over into the XML-based
// element definitions. This also occurs when you have derivation:
// we need to search the schemas for derived types: but WHICH schemas
// should we search.
foreach (ServiceDescription description in serviceDescriptions) {
foreach (Message message in description.Messages) {
foreach (MessagePart part in message.Parts) {
bool isEncoded;
bool isLiteral;
FindUse(part, out isEncoded, out isLiteral);
if (part.Element != null && !part.Element.IsEmpty) {
if (isEncoded) throw new InvalidOperationException(Res.GetString(Res.CanTSpecifyElementOnEncodedMessagePartsPart, part.Name, message.Name));
XmlSchemaElement element = (XmlSchemaElement)allSchemas.Find(part.Element, typeof(XmlSchemaElement));
if (element != null) {
AddSchema(element.Parent as XmlSchema, isEncoded, isLiteral, abstractSchemas, concreteSchemas, references);
if (element.SchemaTypeName != null && !element.SchemaTypeName.IsEmpty) {
XmlSchemaType type = (XmlSchemaType)allSchemas.Find(element.SchemaTypeName, typeof(XmlSchemaType));
if (type != null) {
AddSchema(type.Parent as XmlSchema, isEncoded, isLiteral, abstractSchemas, concreteSchemas, references);
}
}
}
}
if (part.Type != null && !part.Type.IsEmpty) {
XmlSchemaType type = (XmlSchemaType)allSchemas.Find(part.Type, typeof(XmlSchemaType));
if (type != null) {
AddSchema(type.Parent as XmlSchema, isEncoded, isLiteral, abstractSchemas, concreteSchemas, references);
}
}
}
}
}
Hashtable imports;
foreach (XmlSchemas xmlschemas in new XmlSchemas[] { abstractSchemas, concreteSchemas }) {
// collect all imports
imports = new Hashtable();
foreach (XmlSchema schema in xmlschemas) {
AddImport(schema, imports);
}
// make sure we add them to the corresponding schema collections
foreach (XmlSchema schema in imports.Keys) {
if (references[schema] == null && !xmlschemas.Contains(schema)) {
xmlschemas.Add(schema);
}
}
}
// If a schema was not referenced by either a literal or an encoded message part,
// add it to both collections. There's no way to tell which it should be.
imports = new Hashtable();
foreach (XmlSchema schema in allSchemas) {
if (!abstractSchemas.Contains(schema) && !concreteSchemas.Contains(schema)) {
AddImport(schema, imports);
}
}
// make sure we add them to the corresponding schema collections
foreach (XmlSchema schema in imports.Keys) {
if (references[schema] != null)
continue;
if (!abstractSchemas.Contains(schema)) {
abstractSchemas.Add(schema);
}
if (!concreteSchemas.Contains(schema)) {
concreteSchemas.Add(schema);
}
}
if (abstractSchemas.Count > 0) {
foreach (XmlSchema schema in references.Values) {
abstractSchemas.AddReference(schema);
}
StringCollection schemaWarnings = SchemaCompiler.Compile(abstractSchemas);
foreach (string warning in schemaWarnings)
warnings.Add(warning);
}
if (concreteSchemas.Count > 0) {
foreach (XmlSchema schema in references.Values) {
concreteSchemas.AddReference(schema);
}
StringCollection schemaWarnings = SchemaCompiler.Compile(concreteSchemas);
foreach (string warning in schemaWarnings)
warnings.Add(warning);
}
if (ProtocolName.Length > 0) {
// If a protocol was specified, only try that one
ProtocolImporter importer = FindImporterByName(ProtocolName);
if (importer.GenerateCode(codeNamespace, importContext, exportContext)) return importer.Warnings;
}
else {
// Otherwise, do "best" protocol (first one that generates something)
for (int i = 0; i < importers.Length; i++) {
ProtocolImporter importer = importers[i];
if (importer.GenerateCode(codeNamespace, importContext, exportContext)) {
return importer.Warnings;
}
}
}
return ServiceDescriptionImportWarnings.NoCodeGenerated;
}
private static void AddSchema(XmlSchema schema, bool isEncoded, bool isLiteral, XmlSchemas abstractSchemas, XmlSchemas concreteSchemas, Hashtable references) {
if (schema != null) {
if (isEncoded && !abstractSchemas.Contains(schema)) {
if (references.Contains(schema)) {
abstractSchemas.AddReference(schema);
}
else {
abstractSchemas.Add(schema);
}
}
if (isLiteral && !concreteSchemas.Contains(schema)) {
if (references.Contains(schema)) {
concreteSchemas.AddReference(schema);
}
else {
concreteSchemas.Add(schema);
}
}
}
}
}
}
|