Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="values"></param>
        public void CallMethod(object[] values)
        {
            //  Initialize the call

            DynamicWebServiceProxy wsp = new DynamicWebServiceProxy();

            wsp.EnableMessageAccess = true;
            wsp.Wsdl       = _theMethod.Parent.Parent.WSDL;
            wsp.TypeName   = _theMethod.Parent.Name;
            wsp.MethodName = _theMethod.Name;
            wsp.Url        = new Uri(_theMethod.Parent.Parent.EndPoint);
            foreach (object o in values)
            {
                wsp.AddParameter(o);
            }

            //  Make the call
            try
            {
                object result = wsp.InvokeCall();
                _listener.HandleCall(_theMethod, values, wsp.SoapRequest, wsp.SoapResponse, null);
            }
            catch (Exception ex)
            {
                // System.Console.WriteLine("Exception while invoking call: {0}", ex.Message);
                _listener.HandleCall(_theMethod, values, wsp.SoapRequest, wsp.SoapResponse, ex.InnerException);
            }
        }
Esempio n. 2
0
        private void Init()
        {
            wsp.TypeName   = cbTypes.SelectedItem.ToString();
            wsp.MethodName = cbMethods.SelectedItem.ToString();
            wsp.Url        = new Uri(tbEndpoint.Text);

            for (int i = 0; i < this.panel1.Controls.Count / 2; i++)
            {
                object paramValue = this.panel1.Controls[i * 2].Text;
                if (!paramInfo[i].IsOut)
                {
                    paramValue = Convert.ChangeType(paramValue, paramInfo[i].ParameterType);
                }

                // out params are not supported here! An exception will be raised.

                wsp.AddParameter(paramValue);
            }

            bnInvoke.Enabled = true;
        }