0
votes

We developed/tested CRUD operations of Sandbox SalesForce Enterprise WSDL object through .NET application. We create Web Service Reference in the .NET IDE by authenticating using User and Pasword in "Add Web Reference" dialog box which creates SFWebRference with wsdl and Reference.map file.

We use the following .NET code to instantiate SalesForce objects:

_sForceRef = New SforceService()
_loginResults = _sForceRef.login(SalesForce_User, SalesForce_Password & SalesForce_Token)
_sessionId = _loginResults.sessionId

_sForceRef.Url = _loginResults.serverUrl
_sForceRef.SessionHeaderValue = New SessionHeader()
_sForceRef.SessionHeaderValue.sessionId = _sessionId

We tested against Sandbox SalesForce, and now we want to deploy this solution in the Production using Production SalesForce Web Reference. Should I need to create a separate Web Service Reference for Production SalesForce and have a different object (other than SforceService()) and handle in the code to check Test or Production to use the respective objects?

I tried to use _sForceRef.Url = and it didn’t work.

It's not letting us to set _sForceRef.URL = , before we call _sForceRef.Login() with respective credentials, so do we need 2 Separate SalesForce Web Service Reference objects (Sandbox and Prod)? Please let me know your thoughts. I will be online in a short while.

1

1 Answers

0
votes

Yes, you'll need to set up two web services - one that connects to test.salesforce.com and another to login.salesforce.com The code will stay the same, once you login you'll get the redirect URL and will use it for all subsequent calls. That logic doesn't change for sandbox vs production.