Пример #1
0
        internal override void LoadExternals(Hashtable loadedExternals)
        {
            ServiceDescription contract = null;

            try
            {
                contract = this.Contract;
            }
            catch (Exception exception)
            {
                if (((exception is ThreadAbortException) || (exception is StackOverflowException)) || (exception is OutOfMemoryException))
                {
                    throw;
                }
                base.ClientProtocol.Errors[this.Url] = exception;
                if (Tracing.On)
                {
                    Tracing.ExceptionCatch(TraceEventType.Warning, this, "LoadExternals", exception);
                }
            }
            if (contract != null)
            {
                foreach (XmlSchema schema in this.Contract.Types.Schemas)
                {
                    SchemaReference.LoadExternals(schema, this.Url, base.ClientProtocol, loadedExternals);
                }
            }
        }
Пример #2
0
 internal static void LoadExternals(XmlSchema schema, string url, DiscoveryClientProtocol client, Hashtable loadedExternals)
 {
     if (schema == null)
     {
         return;
     }
     foreach (XmlSchemaExternal external in schema.Includes)
     {
         if (external.SchemaLocation == null || external.SchemaLocation.Length == 0 || external.Schema != null)
         {
             continue;
         }
         if (external is XmlSchemaInclude || external is XmlSchemaRedefine)
         {
             string location = UriToString(url, external.SchemaLocation);
             if (client.References[location] is SchemaReference)
             {
                 SchemaReference externalRef = (SchemaReference)client.References[location];
                 external.Schema = externalRef.GetSchema();
                 if (external.Schema != null)
                 {
                     loadedExternals[location] = external.Schema;
                 }
                 externalRef.LoadExternals(loadedExternals);
             }
         }
     }
 }
Пример #3
0
        internal override void LoadExternals(Hashtable loadedExternals)
        {
            ServiceDescription contract = null;

            try {
                contract = Contract;
            }
            catch (Exception e) {
                if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException)
                {
                    throw;
                }
                // don't let the exception out - keep going. Just add it to the list of errors.
                ClientProtocol.Errors[Url] = e;
                if (Tracing.On)
                {
                    Tracing.ExceptionCatch(TraceEventType.Warning, this, "LoadExternals", e);
                }
            }
            if (contract != null)
            {
                foreach (XmlSchema schema in Contract.Types.Schemas)
                {
                    SchemaReference.LoadExternals(schema, Url, ClientProtocol, loadedExternals);
                }
            }
        }
Пример #4
0
 internal static void LoadExternals(XmlSchema schema, string url, DiscoveryClientProtocol client, Hashtable loadedExternals)
 {
     if (schema != null)
     {
         foreach (XmlSchemaExternal external in schema.Includes)
         {
             if ((((external.SchemaLocation != null) && (external.SchemaLocation.Length != 0)) && (external.Schema == null)) && ((external is XmlSchemaInclude) || (external is XmlSchemaRedefine)))
             {
                 string str = DiscoveryReference.UriToString(url, external.SchemaLocation);
                 if (client.References[str] is SchemaReference)
                 {
                     SchemaReference reference = (SchemaReference)client.References[str];
                     external.Schema = reference.GetSchema();
                     if (external.Schema != null)
                     {
                         loadedExternals[str] = external.Schema;
                     }
                     reference.LoadExternals(loadedExternals);
                 }
             }
         }
     }
 }