Place of WCF service in a Silverlight + PRISM application

Topics: Prism v2 - Silverlight 2
Jun 3, 2009 at 5:18 PM

Hello,

I'm very new to PRISM but I've been though most of the documentation and I can't find an example that combines Silverlight with a WCF service.

I have the main project with App.xaml, the Shell and the Bootstrapper. I have a project SourceModule which contains a View and a PresentationModel.

What I want to know is where should I reference my WCF service and where should I make the asynchronous calls ?

Any insight or links to a clear demo would be very much appreciated.


Thanks

Jun 3, 2009 at 8:22 PM

Hi graphicsxp,

 

Prism perfectly support WCF but it doesn't add any special infrastructure or guidance on how to consume WCF services as it focuses on composing the UI.

There are several ways you can achieve this, depending on your scenario. You might want to register proxy services in the container (to make them accessible to all modules), add a special module that register all the services, access WCF services directly from a module (if there is only one module that uses that service), etc.

 

There are some related discussions in the forum that might help you:

·         Prism V2 - Siliverlight Web Services Hands On Labs? 

·         Prism V2 Silverlight - Retrieve data    

 

There is also a good article on this kind of architectures that might be interesting: Optimizing A Large Scale Software + Services Application

 

Hope it helps!

 

Matias Bonaventura

http://blogs.southworks.net/matiasb

Jun 18, 2009 at 9:18 PM

I recently posted an example of using WCF from Prism to show a working example of how to do things. It's a really simple "Hello World" application that communicates with WCF for GET/UPDATE operations. The post includes links to the source code. I wrote it after digging through many of the examples out there and based on the best practices I could find. My post also includes some helpful links to provide background on where I found out how to do it.

Jun 19, 2009 at 3:29 PM

I've a specific module to hold a Service Reference to my WCF web service, and I've put the service client proxy class in my Infrastructure project and registered it with the Unity container with RegisterInstance to be a Singleton for use across the application and modules...