function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
karol.freebergkarol.freeberg 

What is the URL to access the soap api in the sandbox?

I use the following URL to access our production soap api: https://www.salesforce.com/services/soap/u/18.0 
I would like to know what is the URL to access the soap api in the sandbox. I tried adding the sandbox server to the URL https://cs26.salesforce.com/services/soap/u/18.0 but that did not work. Any suggestions? 
Daniel BallingerDaniel Ballinger
You will want to use https://test.salesforce.com/services/soap/u/18.0 when performing a login call to a sandbox. It will send back a new serverURL to use for subsequent calls.

Also, you should change your production URL from https://www.salesforce.com/services/soap/u/18.0 to https://login.salesforce.com/services/soap/u/18.0. See API Endpoint Change Effective 1/1/2016 Salesforce (http://salesforce.stackexchange.com/q/97414/102)
Matt Heidenreich 8Matt Heidenreich 8
One note on the answer above, capitalization does matter in some instances, this is the correct URL for a sandbox:  https://test.salesforce.com/services/Soap/u/42.0
Steve Moore 4Steve Moore 4
Is switching the env between test/prod as simple as changing the last lines of the WSDL?
 
<service name="SforceService">
    <documentation>Sforce SOAP API</documentation>
    <port name="Soap" binding="tns:SoapBinding">
      <soap:address location="https://login.salesforce.com/services/Soap/c/48.0/UNIQUEID" />
    </port>
  </service>


 
Daniel BallingerDaniel Ballinger

Typically you wouldn't be changing the endpoint in the WSDLs port definition. Ideally you could change it dynamically in the code that is using the WSDL. They you can use the same WSDL against both sandbox and production environments.

However, if your tooling won't allow that you can change it in the WSDL.