Is it possible to retrieve the concrete class instance from the ServiceHost, so that I can add an event handler for the events of that class?
Public Class Widget
Public Event MessageCalled(sender as object, e as EventArgs)
Public Sub DoSomething()
'-- do a whole lot of stuff --'
RaiseEvent MessageCalled(Me, new EventArgs())
End Sub
End Class
Private _host As New ServiceHost(GetType(Widget), New Uri() {New Uri("http://localhost:50000")})
So when the client calls the DoSomething() method, I can handle the MessageCalled() event on the host.
Most of what I've found talks about handling events on the client, but I'm not interested in this.