private void InvokeWebMethod() { MethodProperty currentMethodProperty = GetCurrentMethodProperty(); if (currentMethodProperty != null) { HttpWebClientProtocol proxy = currentMethodProperty.GetProxyProperty().GetProxy(); RequestProperties properties = new RequestProperties(proxy); try { MethodInfo method = currentMethodProperty.GetMethod(); System.Type declaringType = method.DeclaringType; WSSWebRequest.RequestTrace = properties; object[] parameters = currentMethodProperty.ReadChildren() as object[]; object result = method.Invoke(proxy, BindingFlags.Public, null, parameters, null); treeOutput.Nodes.Clear(); MethodProperty property2 = new MethodProperty(currentMethodProperty.GetProxyProperty(), method, result, parameters); property2.RecreateSubtree(null); treeOutput.Nodes.Add(property2.TreeNode); treeOutput.ExpandAll(); } finally { WSSWebRequest.RequestTrace = null; propRequest.SelectedObject = properties; richRequest.Text = properties.requestPayLoad; richResponse.Text = properties.responsePayLoad; } } }
private void treeMethods_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.Tag is MethodInfo) { MethodInfo tag = e.Node.Tag as MethodInfo; treeInput.Nodes.Clear(); MethodProperty property = new MethodProperty(GetProxyPropertyFromNode(e.Node), tag); property.RecreateSubtree(null); treeInput.Nodes.Add(property.TreeNode); e.Node.Tag = property.TreeNode; } else if (e.Node.Tag is TreeNode) { treeInput.Nodes.Clear(); treeInput.Nodes.Add((TreeNode)e.Node.Tag); } treeInput.ExpandAll(); treeInput.SelectedNode = treeInput.Nodes[0]; }