Search code examples
c#wcfweb-servicesvirtual-earth

Interface to a webservice?


I have two webservices that have exactly the same methods and signatures but point at different servers (specifically the Virtual Earth production and staging environments). I wish to switch between using the production and staging services on the basis of a config setting and don't want to repeat myself and replicate each method where I call one of the services.

So what I need in effect is to create an interface which both of the services can implement and program against that. But I don't know if this is advisable or even possible.

Or do I just need to reference one of the services and switch the url property depending on whether I want to use the production or staging environment?


Solution

  • If I understand you right, you have ONE webservice which is deployed in production and staging environments. In this case the only thing you have to do is to switch between them via the Url property.