R
Richard Kure
Is it possible to get a webservice to call to a Windows Form? Both the
webservice and the form are running at the same computer.
I work in C#.NET in Visual Studio. I tried to make an eventin the
webservice, which to form should listen to. But you cant see the event when
you add the webservice to the form project. The only event I could see was
'Dispose'. So it looks like it is possible to make events in a webservice,
when it has the 'Dispose' itself, but how to make it?
ex.
public delegate bool ErrorReceivedHandler(object sender, MessageEventArgs
e);
public class Test : System.Web.Services.WebService
{
public event ErrorReceivedHandler errorReceived;
public bool onErrorReceived(ErrorMessageArrayEventArgs e)
{
if (errorReceived != null)
{
return errorReceived(this, e);
}
else
{
return false;
}
}
[WebMethod]
public bool sendMessage(string message)
{
return this.onErrorReceived(this, new EventArgs())
}
But you couldn't see the event 'errorReceived', when you add the reference
in the form project.
webservice and the form are running at the same computer.
I work in C#.NET in Visual Studio. I tried to make an eventin the
webservice, which to form should listen to. But you cant see the event when
you add the webservice to the form project. The only event I could see was
'Dispose'. So it looks like it is possible to make events in a webservice,
when it has the 'Dispose' itself, but how to make it?
ex.
public delegate bool ErrorReceivedHandler(object sender, MessageEventArgs
e);
public class Test : System.Web.Services.WebService
{
public event ErrorReceivedHandler errorReceived;
public bool onErrorReceived(ErrorMessageArrayEventArgs e)
{
if (errorReceived != null)
{
return errorReceived(this, e);
}
else
{
return false;
}
}
[WebMethod]
public bool sendMessage(string message)
{
return this.onErrorReceived(this, new EventArgs())
}
But you couldn't see the event 'errorReceived', when you add the reference
in the form project.