I have created web references in my Visual Studio console project using WSDL files for Salesforce production and Salesforce sandbox.
I am trying to write the program like so:
ServiceClass client;
if(Debug)
{
client = Test.SforceService;
}
else
{
client = Prod.SforceService;
}
Problem is, the SforceService class is auto-generated, so I can't implement the ServiceClass in their files.
What are my options?
When you inspect the WSDL at the end there should be something like this:
My C# days are long gone but try to look for matching section in the generated class. If it's a String property you should be able to override the default value with
login.salesforce.com(or other way around) in runtime?