Ejemplo 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);
            }
        }