Jump to content

Asynchronous .Net web service call


Recommended Posts

Hi!

How do I call .Net web service functions from the .Net-web-service-browser-generated dll, asynchronously? I noticed that there's a generated Beginfoo()/Endfoo() pair of methods for every foo() method. I'm thinking of calling Beginfoo() then call Endfoo() in a callback vi. Unfortunately, Beginfoo() has callback and asyncstate as parameters. The former is an AsyncCallback while the latter is an Object. I tried wiring an Open VI Reference to callback but there's a wiring error because the sink is a .Net refnum. I also tried casting it to a .Net refnum abd other variations but the wiring problem still exists. So, how do I wire the callback? What should I wire to the asyncstate?

Link to comment

The solution, as suggested here, is to use events. It seems that the .Net Web Service Browser does not automatically create events for the asynchronous calls. The tool wsdl.exe generates codes with events but must be compiled. I used Visual C# Express as compiler. The resulting dll will have a fooAsync() method and a fooCompleted event for every foo(). Use the Result property of the e Event Data to get the results in the callback.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.