views:

110

answers:

3

Hi,

I am using prism and have a number of modules. In several of them I am making webservice and wcf calls. I want to be able to configure the information about these services in one place. Should I do this in a resources.resx file? I remember a settings.setting file but that was in a web application.

JD

+2  A: 

You can put it in the app.config or you can follow this blog on passing server information to the Silverlight client.

Silverlight Bits&Pieces has this piece on Silverlight configuration options.

0A0D
Thanks, excellent links.
JD
+2  A: 

When you create service reference in a Silverlight Application, it should automatically generate a ServiceReferences.ClientConfig XML file and put it in your project. It will put the binding and endpoint config info in this file. If you create an instance of your service proxy object without specifying any binding/endpoint it will use the info from the file.

Dan Auclair
A: 

Hi there, What you can do is the following:

  1. In the Bootstrapper application, add a reference to that WCF
  2. Create your own custom proxy class imlpementing an interface that dictates the methods to be called
  3. Register this IProxy with Unity Container, then pass to each of your ViewModels an IProxy parameter. Unity will do the job by injecting the real instance of that IProxy.

This way you have based all the WCF connection in one place.

Does it help?

Regards

bhaidar