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 string GenerateClientCode() { Script script = new Script(wsdl.ProxyNamespace, "MainClass"); foreach (TreeNode node in treeMethods.Nodes) { script.Proxy = GetProxyPropertyFromNode(node).GetProxy(); foreach (TreeNode node2 in node.Nodes) { TreeNode tag = node2.Tag as TreeNode; if (tag != null) { MethodProperty property = tag.Tag as MethodProperty; if (property != null) { MethodInfo method = property.GetMethod(); object[] parameters = property.ReadChildren() as object[]; script.AddMethod(method, parameters); } } } } return(script.Generate(this.wsdl.GetCodeGenerator)); }