473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Implementing Callback Web Method

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.
Nov 12 '06 #1
2 3246
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.

Nov 12 '06 #2
"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.
Web Services cannot call back. They can be called asynchronously, but they
can't actually do a callback.

John
Nov 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: scott ocamb | last post by:
hello I have implemented a solution using async methods. There is one async method that can be invoked multiple times, ie there are multiple async "threads" running at a time. When these...
3
by: ThinkRS232 | last post by:
I have a Win32 DLL that has a standard _stdcall (WINAPI) exports. I am able to call these fine from C#. One call in particular however has a callback to a CDECL function. How would I set that up?...
2
by: MR | last post by:
help! I have an unmanaged DLL that I do not have the source code, so i can't recompile or make changes. the DLL requires a callback function. I would like to implement the callback method in a...
8
by: kurtcobain1978 | last post by:
-------------------------------------------------------------------------------- I need to do the exactly same thing in VB.NET. Load a unmanaged C DLL dynamically and then call a function in...
5
by: Maxwell | last post by:
Hello, Newbie question here. I have a VS.NET 2003 MC++ (not C++/cli) project where I have a managed class reference in a unmanaged class...simple enough. To keep things short I am for the most...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
2
by: Jon E. Scott | last post by:
I've got a project where I need to create a C# project and a Delphi DLL, in which the DLL has a callback function to send statuses back to the C# application. It seems pretty straightforward in a...
2
by: durumdara | last post by:
Hi! I want to check my zip file writings. I need some callback procedure to show a progress bar. Can I do that? I don't want to modify the PyLib module to extend it, because if I get another...
21
by: puzzlecracker | last post by:
Problem: I send a lot of requests to the application (running on a different box, of course), and I receive back responses from the app . Below: socket corresponds to Socket socket=new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.