Asynchronous web service invocation

  • Thread starter Giulio Petrucci
  • Start date
G

Giulio Petrucci

Hi there,

I have a simple web service, exposing a web method DoSomething() which
might take a lot to execute. I'm writing a client application (using
..NET FW *2.0*) and I'd like to invoke it asynchronously. I did the
following:
- create a proxy class "Service.cs" runnind disco+wsdl against the web
service interface;
- import it in my project;

1) I tried to use the DoSomethingAsync() and wait for the
DoSomethingComplete event but I could not getting it working: the *real*
web service returned properly but the event wasn't generated at all. Any
suggestion?
2) I tried using the BeginDoSomething/EndDoSomething pattern and
everything worked fine;
3) Is the Begin/End patter *old-style*? I must confess I did't get it...

Thanks in advance.
Have a nice day,
Giulio - Italia
 
M

Marc Gravell

Well, if all else fails you could use the regular (sync) method, but call it
from a worker thread? OK, this might not make optimal use of IO completion
ports etc, but by 'eck it'll work.

For the record, I also have to concentrate hard with the Begin/End pattern
using AsyncCallback; it has never seemed intuitive to me...

Marc
 
G

Giulio Petrucci

Hi Marc,

thanks for your reply.

Marc Gravell ha scritto:
Well, if all else fails you could use the regular (sync) method, but call it
from a worker thread? OK, this might not make optimal use of IO completion
ports etc, but by 'eck it'll work.

Uhm... don't know.
As far as I could get, the "big deal" is server-side, as it's the server
getting decisions about timeout, right?
For the record, I also have to concentrate hard with the Begin/End pattern
using AsyncCallback; it has never seemed intuitive to me...

I made a lot of practice with sockets... ;-)

Thanks,
Giulio
 
V

vvnraman

Hi Marc,

thanks for your reply.

Marc Gravell ha scritto:


Uhm... don't know.
As far as I could get, the "big deal" is server-side, as it's the server
getting decisions about timeout, right?


I made a lot of practice with sockets... ;-)

Thanks,
Giulio

Hi Giulio Petrucci
I answered a similar query for the following question. Please visit
the link below.

http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/eef8164bffb9bc02

In the sample code i've given the method bgWorker_GenerateThumbnails()
is handling the slow part of the program.
You can use this to invocate your web service.

If you can provide some details regarding how you're trying to access
the service in code, i can help you with some more specific code.

Hope this helps
Prateek
 
G

Giulio Petrucci

Hi Steve,

Steve Gerrard ha scritto:
I don't see why you are giving up on that. It does work in other cases - mine,
for instance.
Any idea why it isn't working?

No, I have no idea.
And *that* is the real problem... I tried to debug the whole application
going step-by-step but I couldn't get out of it...

Regards,
Giulio
 
G

Giulio Petrucci

Hi Prateek

thanks for your reply.

vvnraman ha scritto:
Hi Giulio Petrucci

Just "Giulio" ;-)
I answered a similar query for the following question. Please visit
the link below.
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/eef8164bffb9bc02

Thanks for thee link. I'm taking a look.
In the sample code i've given the method bgWorker_GenerateThumbnails()
is handling the slow part of the program.
You can use this to invocate your web service.

I'll try and let you know.
If you can provide some details regarding how you're trying to access
the service in code, i can help you with some more specific code.

Ok! Just give me the time to build up an example to be published and
will come back here!
;-)

Thanks again,
Giulio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top