Jonathan D
Jonathan D

Reputation: 1364

Soap server address in silverlight

In my silverlight light apps im normally connecting to a ASMX or WCF web service.

I was wonder what is the best way of holding the url in the app of where the soap client should be looking at.

This is fine in debug because it just sort of knows, but in release and depending where its using an ip or it swaps production servers i keep getting tripped up.

I would love there to be some sort of client config bit like web config

Upvotes: 1

Views: 166

Answers (2)

Aaron McIver
Aaron McIver

Reputation: 24723

Your service endpoints can go in to a ServiceReferences.ClientConfig file. This is then an XML file and can be changed at any point as needed; ie..at deployment, etc...

Upvotes: 1

ChrisF
ChrisF

Reputation: 137188

You can have client configuration by using Isolated Storage.

You work with Key/Value pairs as in this example from the linked page:

// Create an instance of IsolatedStorageSettings.
private IsolatedStorageSettings userSettings =
    IsolatedStorageSettings.ApplicationSettings;

// Add a key and its value.
userSettings.Add("userImage", "BlueHills.jpg");

// Remove the setting.
userSettings.Remove("userImage");

So you can have the value as your URL - just choose a suitable key.

Upvotes: 1

Related Questions