Пример #1
0
        public frmMetodosSOAP(SOAPServiceInfo soap, bool cargarAptosInicio)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            try
            {
                List <WSDLProxyMethod> availableMethods = null;
                if (cargarAptosInicio)
                {
                    availableMethods = soap.FindCandidateInitMethods();
                }
                else
                {
                    availableMethods = soap.FindAllMethods();
                }
                this.lMetodos.DataSource    = availableMethods;
                this.lMetodos.DisplayMember = "Name";
                this.lMetodos.ValueMember   = "Name";
                if (availableMethods.Count > 0)
                {
                    this.lMetodos.SelectedItem = availableMethods[0];
                }
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message, "Error al intentar obtener información del Servicio Web", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #2
0
        public frmTestSOAP(SOAPServiceInfo soap)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this._soap = soap;
        }
Пример #3
0
        public frmGruposSOAP(SOAPServiceInfo soap)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            if (soap != null)
            {
                this._soap            = soap;
                this.lG.DataSource    = this._soap.PublicContainer.Groups;
                this.lG.DisplayMember = "Label";
                this.lG.ValueMember   = "Label";
            }
        }
Пример #4
0
        public static TreeNode[] CrearNodosSOAPMethodInfo(SOAPServiceInfo soap, bool useGroups)
        {
            List <TreeNode> nodes = new List <TreeNode>();

            if (useGroups)
            {
                TreeNode pub  = new TreeNode();
                TreeNode priv = new TreeNode();
                pub.Tag   = soap.PublicContainer;
                pub.Name  = soap.PublicContainer.Name;
                pub.Text  = soap.PublicContainer.Name;
                priv.Tag  = soap.PrivateContainer;
                priv.Name = soap.PrivateContainer.Name;
                priv.Text = soap.PrivateContainer.Name;
                foreach (SOAPGroup g in soap.PublicContainer.Groups)
                {
                    TreeNode gNode = new TreeNode();
                    gNode.Tag  = g;
                    gNode.Name = g.Label;
                    gNode.Text = g.Label;
                    foreach (SOAPMethodInfo m in g.Methods)
                    {
                        if (!m.Obsolete)
                        {
                            TreeNode mNode = new TreeNode();
                            mNode.Tag  = m;
                            mNode.Name = m.Name;
                            mNode.Text = m.Label;
                            gNode.Nodes.Add(mNode);
                        }
                    }
                    pub.Nodes.Add(gNode);
                }
                nodes.Add(pub);
                if (!SOAPSettings.UseAnonymousCredentials)
                {
                    foreach (SOAPGroup g in soap.PrivateContainer.Groups)
                    {
                        TreeNode gNode = new TreeNode();
                        gNode.Tag  = g;
                        gNode.Name = g.Label;
                        gNode.Text = g.Label;
                        foreach (SOAPMethodInfo m in g.Methods)
                        {
                            if (!m.Obsolete)
                            {
                                TreeNode mNode = new TreeNode();
                                mNode.Tag  = m;
                                mNode.Name = m.Name;
                                mNode.Text = m.Label;
                                gNode.Nodes.Add(mNode);
                            }
                        }
                        priv.Nodes.Add(gNode);
                    }
                    nodes.Add(priv);
                }
            }
            else
            {
                TreeNode pub  = new TreeNode("Métodos comunes");
                TreeNode priv = new TreeNode("Métodos específicos");
                pub.Tag  = nodosOrdenacion.metodosSOAPPublicos;
                priv.Tag = nodosOrdenacion.metodosSOAPPrivados;
                foreach (SOAPMethodInfo m in soap.VisibleMethods)
                {
                    if (!m.Obsolete)
                    {
                        TreeNode n0;
                        n0      = new TreeNode();
                        n0.Tag  = m;
                        n0.Name = m.Name;
                        n0.Text = m.Label;
                        if (m.Public)
                        {
                            pub.Nodes.Add(n0);
                        }
                        else
                        {
                            if (!SOAPSettings.UseAnonymousCredentials)
                            {
                                priv.Nodes.Add(n0);
                            }
                        }
                    }
                }
                nodes.Add(pub);
                if (!SOAPSettings.UseAnonymousCredentials)
                {
                    nodes.Add(priv);
                }
            }
            return(nodes.ToArray());
        }
Пример #5
0
        public controlClienteSOAP(SOAPServiceInfo soap, SOAPMethodInfo m)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //
            // TODO: Add constructor code after the InitializeComponent() call.
            //
            this._soap = soap;
            this._m    = m;
            int i = 0;

            foreach (SOAPParamInfo p in this._m.Parameters)
            {
                if (p.DataSource == string.Empty || p.ValueMember == string.Empty)
                {
                    if (p.DataType == typeof(bool).Name)
                    {
                        ToolStripButton b = new ToolStripButton();
                        b.Text         = p.Label;
                        b.TextAlign    = System.Drawing.ContentAlignment.MiddleLeft;
                        b.CheckOnClick = true;
                        b.Tag          = p;
                        bool defVal = false;
                        if (bool.TryParse(p.DefaultValue, out defVal))
                        {
                            b.Checked = defVal;
                        }
                        else
                        {
                            b.Checked = false;
                        }
                        b.ToolTipText = p.Comment;
                        this.toolStrip1.Items.Insert(i++, b);
                    }
                    else
                    {
                        ToolStripLabel l = new ToolStripLabel(p.Label);
                        l.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                        this.toolStrip1.Items.Insert(i++, l);
                        ToolStripTextBox t = new ToolStripTextBox();
                        t.Tag         = p;
                        t.Text        = p.DefaultValue;
                        t.ToolTipText = p.Comment;
                        this.toolStrip1.Items.Insert(i++, t);
                    }
                }
                else
                {
                    ToolStripLabel l = new ToolStripLabel(p.Label);
                    l.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
                    this.toolStrip1.Items.Insert(i++, l);
                    ToolStripComboBox c = new ToolStripComboBox();
                    c.ComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                    ApplicationException ex = this.EnlazarCombo(c.ComboBox, p);
                    if (ex != null)
                    {
                        MessageBox.Show(ex.Message + ex.InnerException.Message, "Error en la consulta Web", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    c.Tag         = p;
                    c.ToolTipText = p.Comment;
                    this.toolStrip1.Items.Insert(i++, c);
                }
            }
            this.txAyuda.Text = this._m.Comment;
        }