Example #1
0
        private ArrayList BuildWebServceAssemblyDescriptors(string path, Hashtable typeDescriptorDictionary)
        {
            ArrayList result = new ArrayList();

            try
            {
                foreach (string file in Directory.GetFiles(path, "*.asmx"))
                {
                    string   fileName = Path.GetFileName(file);
                    Assembly assembly = null;
                    try
                    {
                        assembly = WsdlHelper.GetAssemblyFromAsmx(fileName);
                        if (assembly != null)
                        {
                            AssemblyDescriptor assemblyDescriptor = new AssemblyDescriptor();
                            assemblyDescriptor.Build(assembly, true, typeDescriptorDictionary);
                            assemblyDescriptor.Name = fileName;
                            assemblyDescriptor.IsWebServiceProxy = true;
                            result.Add(assemblyDescriptor);
                        }
                    }
                    catch (Exception ex)
                    {
                        AssemblyDescriptor assemblyDescriptor = AssemblyDescriptor.GetNullAssemblyDescriptor(fileName);
                        assemblyDescriptor.Description       = ex.ToString();
                        assemblyDescriptor.IsWebServiceProxy = true;
                        result.Add(assemblyDescriptor);
                    }
                }
            }
            catch (UnauthorizedAccessException)
            {
            }

            try
            {
                foreach (string dir in Directory.GetDirectories(path))
                {
                    if (dir.EndsWith("_vti_cnf"))
                    {
                        continue;
                    }
                    result.AddRange(BuildWebServceAssemblyDescriptors(dir, typeDescriptorDictionary));
                }
            }
            catch (UnauthorizedAccessException)
            {
            }
            return(result);
        }
Example #2
0
        private Type GetTypeForWebService(string webService)
        {
            if ((log != null) && log.get_IsInfoEnabled())
            {
                log.Info(__Res.GetString("Wsdl_ProxyGen", new object[] { webService }));
            }
            Assembly assemblyFromAsmx = WsdlHelper.GetAssemblyFromAsmx(webService);

            if (assemblyFromAsmx != null)
            {
                Type[] types = assemblyFromAsmx.GetTypes();
                if (types.Length > 0)
                {
                    return(types[0]);
                }
            }
            return(null);
        }
Example #3
0
        private Type GetTypeForWebService(string webService)
        {
            if (log != null && log.IsInfoEnabled)
            {
                log.Info(__Res.GetString(__Res.Wsdl_ProxyGen, webService));
            }

            Assembly assembly = WsdlHelper.GetAssemblyFromAsmx(webService);

            if (assembly != null)
            {
                Type[] types = assembly.GetTypes();
                if (types.Length > 0)
                {
                    return(types[0]);
                }
            }
            return(null);
        }