views:

156

answers:

1

I have implemented MVVM in my WPF application. I was wondering what is the correct way to consume a Web Service from WPF MVVM app.

So far, I have created a DataAccess interface and a class that implements this interface. This would serve as a facade / proxy to the web service. The ViewModel gets a reference to this class as the constructor parameter so it can make any calls to get/set data, in this case it will be a Web service call. I would appreciate if you can guide me with some hints and / or direct me to some online resource.

+2  A: 

I know about 3 different ways of writting asynchronous code for MVVM:

We aware that except the "classical" solution all the others use advanced techniques.

DaniCE
We typically use the callback approach, using a callback helper object, that is has a standard way of handling standard Web service exceptions.
Agies
DaniceI am currently using a callback approach. Thank you for the details. I'll have a look at all the approaches including the the classical callback approach you mentioned.Agies, Thank you for letting us know the reason why you use the callback approach.
byte