Example #1
0
        /// <summary>
        /// Gets the web methods.
        /// </summary>
        /// <returns></returns>
        public WebServiceMethods GetWebMethods(MethodInfo[] methodInfos)
        {
            WebServiceMethods = new WebServiceMethods();

            foreach (var methodInfo in methodInfos)
            {
                WebServiceMethodParameters webServiceMethodParameters = new WebServiceMethodParameters();
                webServiceMethodParameters.AddRange(methodInfo.GetParameters().Select(parameterInfo => new WebServiceMethodParameter
                {
                    Name = parameterInfo.Name,
                    Type = parameterInfo.ParameterType.FullName
                }));

                WebServiceMethods.Add(new WebServiceMethod
                {
                    Name       = methodInfo.Name,
                    ResultType = methodInfo.ReturnType.ToString(),
                    WebServiceMethodParameters = webServiceMethodParameters
                });

                AssemblyReferences.Add((methodInfo.ReturnType).Module.Name);
                AssemblyReferences.AddRange(from parameters in methodInfo.GetParameters()
                                            select parameters.ParameterType.Module.ToString());
            }

            return(WebServiceMethods);
        }
Example #2
0
        /// <summary>
        /// Gets the web methods.
        /// </summary>
        /// <returns></returns>
        public WebServiceMethods GetWebMethods(MethodInfo[] methodInfos)
        {
            _webServiceMethods = new WebServiceMethods();

            foreach (MethodInfo methodInfo in methodInfos)
            {
                var webServiceMethodParameters = new WebServiceMethodParameters();
                webServiceMethodParameters.AddRange(methodInfo.GetParameters().Select(parameter => new WebServiceMethodParameter
                {
                    Name = parameter.Name,
                    Type = parameter.ParameterType.FullName
                }));

                _webServiceMethods.Add(new WebServiceMethod
                {
                    Name       = methodInfo.Name,
                    ResultType = methodInfo.ReturnType.ToString(),
                    WebServiceMethodParameters = webServiceMethodParameters
                });
            }

            return(_webServiceMethods);
        }