Hello all,
I have a webservice that is being called through anouther class and
would like to subscribe to the asynch callback event on the service
proxy.
Psuedo code:
class foo
{
public voidCallIntClassWS(int param)
{
return intClass.CallWSAsych(param);
}
}
class WebServiceIntermediateSvcClass
{
ActualWebService ws = new ActualWebService();
public foo()
{
ws.AsynchEvent += new AsychEventEventHandler
(ws_AsynchEventCompleted);
}
public void CallWSAsynch(int param)
{
ws.ActualCallAsynch(param);
}
private void ws_AsynchEventCompleted(object sender,
AsynchCallCompletedCompletedEventArgs e)
{
//Do Stuff
}
}
class ActualWebService
{
public event AsynchCallCompletedEventHandler
AsynchCallCompleted;
public delegate void AsynchCallCompletedEventHandlerr(object
sender, AsynchCallCompletedCompletedEventArgs e);
public void ActualCallAsnch(int param)
{
//invoke webservice call
}
}
}
I believe I covered everything here. Hopefully this is enough as the
actual code is very long and complex.
As you can see, we are using an intermediate service class that
actually brokers the call to the webservice. Currently that service
class subscribes to the completed event. I would like to have the top-
level class (Foo) actually handle the callback. Is there a way to do
this?
Any suggestions would be greatly appreciated.
Best regards and thank you in advance!
rbr