The code exits because it reaches the end of main. There's no magic here -
the code works like it always did. When main runs out, the program will
terminate. What you need to do is put a wait loop into your main. This
would be the worker thread, or whatever does the text display you spoke of
while the service is being invoked in the background. FYI, the service
isn't async, and neither is your call. This begin/end behavior simply
spins up a background thread that makes the synchronous call for you, and
then calls your registered callback method when the response is received.
Your program has to exist (e.g not have exited) for this to work.
--------------------
>Thread-Topic: Asynchronous web services
>thread-index: AcUTblQ87n6jW28vRRCc14ykFnMyWQ==
[quoted text clipped - 17 lines]
>Path: TK2MSFTNGXA01.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
>Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:5535
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 28 lines]
>
>jez
jez - 16 Feb 2005 09:09 GMT
Thanks a lot for the explanation. I created a windows app to test the the
behavior (as it does not "simply" exit at the end of the main method) and
could indeed see the correct "asynchronous" behavior taking place. Thank you
for the clarification.
jez
> The code exits because it reaches the end of main. There's no magic here -
> the code works like it always did. When main runs out, the program will
[quoted text clipped - 67 lines]
> >
> >jez