As far as I know, once a proxy class for a webservice is generated, either
directly by calling wsdl.exe from the command line or through Visual Studio,
the proxy class would contain additional pair of asynchronous methods for
each Webmethod you define.
i.e, if you define webmethod like
[WebMethod]
public int sum(int a, int b)
{
return (a+b);
}
you would also get a pair of methods called Beginsum and Endsum in the proxy
class which you can use to call the webmethod asynchronously.
e.g.
s1 = new Service1(); //s1 is your webservice type
AsyncCallback ac = new AsyncCallback(myCallback);
object state;
IAsyncResult ar = s1.Beginsum(3,2,ac, state);
The callback would look like
void myCallback(IAsyncResult ar)
{
int x;
x = s1.Endsum(ar); // x = 3 + 2
}
Now, as far as I can see, the link you refer to shows how to implement a
mechanism by which you can call a web service asynchronously from another
web service's webmethod which in turn could be called asynchronously from a
desktop app for example, which is a more specific case.
"Baheri" <Ba****@discussions.microsoft.comwrote in message
news:CD**********************************@microsof t.com...
>I am trying to find an example on how .net do I implements a webmethod that
will callback after it has completed its task. I found a nice sample on
the
Microsoft website
http://msdn2.microsoft.com/en-us/library/98t3s469.aspx
How ever the sample is incomplete. It does not tell me what I need to do
at
the remote service end e.g. in the sample it does not tell me how to
implement the following method in my remote service:
return remoteService.BeginReturnedStronglyTypedDS(Author,
callback,asyncState);
Any help will be appriciated. Or even if any one knows of a link to a more
complete example will be great.