views:

21

answers:

2

I have an app that uses a couple of SOA calls to get some information from a database. For now we have been sending these calls to a test server, but in the near future the QA team will be using this, and they have their own QA database, and then of course we have the production server.

Normally I would do an #if #define type of deal, but I have not used SOA before and I am not sure how to change the server url's, which I think reside in the App.Config and Service references folder in XML, on the fly.

Just as a side note, the calls are all identical in how they function, they just have different database locations.

A: 

Build and Debug mode adds complexity to your code. In the worst case, use at build mode. I had the following experiences:

  1. Deploy Services on a different environment (server), configure the service to the QA database and use different URL. That's the easiest way. Have an continuous integration system to perform deploy on both environments.

  2. Have your service to work like in SaaS environment, find a secure way to pass the database name on message header as payload staff. There's nothing wrong with that. So, your DbProd or DbQA will be worked as you want. An special database soa user need to be created with limited privilege to both databases.

Eduardo Xavier
+1  A: 

If you use app.config / web.config, then all you need to do is change the URL in the config file in the different environments.

John Saunders