Exemplo n.º 1
0
        /// <summary>
        /// Gets the service methods.
        /// </summary>
        /// <param name="serviceName">Name of the service.</param>
        /// <returns></returns>
        public List <string> GetServiceMethods(string serviceName)
        {
            if (!_availableTypes.ContainsKey(serviceName))
            {
                throw new Exception("Service Not Available");
            }

            Type type = _availableTypes[serviceName];

            var methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly).Select(method => method.Name).ToList();

            WebServiceMethods = GetWebMethods(type.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly));

            foreach (var contractDescription in Contracts)
            {
                if (contractDescription.Name == serviceName && !AvailableServices.ContainsKey(serviceName))
                {
                    AvailableServices.Add(serviceName, WebServiceMethods);
                }
            }

            return(methods);
        }