Hi.
I have a web application without reference to webservice. My application needs connect with any web services. To make this, the application get a list of web services when it need.
To call this web services, we create an instance of MethodInfo class and use the Invoke method like this:
methodInfo.Invoke(instance, BindingFlags.InvokeMethod, null, null, null);
This work fine. The next step would be stop service at any moment. Either a timeuot or a simple button.
var thread = new Thread(() =>
{
methodInfo.Invoke(instance, BindingFlags.InvokeMethod, null, null, null);
});
thread.Start();
if (!thread.Join(TimeSpan.FromSeconds(60)))
{
thread.Abort();
throw new Exception("Timeout - 1 minute");
}The code above is work fine. The instance parameter contains the name of the web service that I need to connect. However if I verify in database, the process is still running.
Can anyone help me, please?
Thanks
Thiago