0

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?

ChasetopherB
  • 466
  • 9
  • 23

1 Answers1

0

When you inspect the WSDL at the end there should be something like this:

<service name="SforceService">
    <documentation>Sforce SOAP API</documentation>
    <port binding="tns:SoapBinding" name="Soap">
        <soap:address location="https://test.salesforce.com/services/Soap/u/48.0"/>
    </port>
</service>

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?

eyescream
  • 18,088
  • 2
  • 34
  • 46