ianalis Posted November 11, 2008 Report Share Posted November 11, 2008 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? Quote Link to comment
ianalis Posted November 15, 2008 Author Report Share Posted November 15, 2008 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.