vb.net - How to handle Async method that returns Void with WCF service on Windows Phone -


i've created client app on windows phone (8.0) consumes wcf service. i've added service project using add service reference.. want call methods asynchronously can't figure out how in vb. i've seen lot of c# examples understand somehow can't figure out in vb, since not of vb programmer.

what create client this:

client = new isscompanionappserviceclient("isscompanionapp") 

where "isscompanionapp" endpoint. can call method: client.getsecuritytokenasync(username, password) valid method in service. method doesn't return value. how can pass callback in method? service have event handlers defined like: getsecuritytokencompleted(object, getsecuritytokencompletedeventargs) how implement this?

i've searched on web examples either not applicable or in c#...

i hate answer own questions found solution after more searching!

this code used solve problem:

 public shared sub login(byval username string, byval password string)     dim client = new isscompanionappserviceclient("isscompanionapp")     addhandler client.getsecuritytokencompleted, addressof getsecuritytokencallback     client.getsecuritytokenasync(username, password) end sub  private shared sub getsecuritytokencallback(byval sender object, byval e issservice.getsecuritytokencompletedeventargs)     messagebox.show(e.result) end sub 

so needed add handler client.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -