コード例 #1
0
        public BussinessObject getBO(string name)
        {
            BussinessObject bo = null;

            foreach (var item in this.BussinesObjects)
            {
                if (item.Name.ToUpper().Equals(name.ToUpper()))
                {
                    bo = item;
                    break;
                }
            }

            return(bo);
        }
コード例 #2
0
        public void LoadWSDL(XmlDocument doc)
        {
            XmlNodeList nodes = doc.GetElementsByTagName("service");

            if (nodes.Count > 0)
            {
                this.serviceName   = nodes[0].Attributes.GetNamedItem("name").Value;
                this.Type          = this.ParseEnum <ServiceType>(nodes[0].Attributes.GetNamedItem("type").Value);
                this.Domain        = nodes[0].Attributes.GetNamedItem("domain").Value;
                this.Documentation = nodes[0].ChildNodes[0].InnerText;

                XmlNode         schemas = nodes[0].ChildNodes[2];
                BussinessObject bo      = null;

                foreach (XmlNode item in schemas.ChildNodes)
                {
                    bo = new BussinessObject();

                    bo.Name      = item.Attributes.GetNamedItem("name").Value;
                    bo.Path      = item.Attributes.GetNamedItem("path").Value;
                    bo.NameSpace = item.Attributes.GetNamedItem("namespace").Value;

                    if (item.Attributes.GetNamedItem("domain") != null)
                    {
                        bo.Domain = item.Attributes.GetNamedItem("domain").Value;
                    }

                    if (item.Attributes.GetNamedItem("isExtern") != null)
                    {
                        bo.IsExtern = Boolean.Parse(item.Attributes.GetNamedItem("isExtern").Value);
                    }

                    this.BussinesObjects.Add(bo);
                }

                XmlNode methods = nodes[0].ChildNodes[1];

                Capacity  method;
                Parameter param = null;

                foreach (XmlNode item in methods.ChildNodes)
                {
                    method = new Capacity();

                    method.Name          = item.Attributes.GetNamedItem("name").Value;
                    method.Documentation = item.Attributes.GetNamedItem("description").Value;

                    if (item.ChildNodes[0] != null)
                    {
                        foreach (XmlNode parameter in item.ChildNodes[0].ChildNodes)
                        {
                            param = ConfigParameter(parameter);
                            method.ParametersIn.Add(param);
                        }
                    }

                    if (item.ChildNodes[1] != null)
                    {
                        foreach (XmlNode parameter in item.ChildNodes[1].ChildNodes)
                        {
                            param = ConfigParameter(parameter);
                            method.ParametersOut.Add(param);
                        }
                    }

                    this.methods.Add(method);
                }
            }
            else
            {
                throw new Exception("Archivo no valido.");
            }
        }