Salesforce Integration with .Net – Web Services SOAP API

Sales Force is the top rated Sales application in the world today.

This post will be on the common way to connect .Net Applications to connect Salesforce for data Operations(CRUD). This method is the Web services SOAP API.

Salesforce Web Services  SOAP API comprised of various WSDLs as shown in the below figure.

To Download the WSDLs create a account.To Build an integration with Salesforce Enterprise wsdl is the common API.

Here are the steps that can be taken to setup the integration :

 1. Create a ASP.Net Application
 2. Create a web reference  to the WSDL (Enterprise) downloaded.
 3. Create Service instance to access the Salesforce API methods.


4. To authenticate we can use the ‘login” method on an instance of the SforceService while passing the username and password. The password needs to have the security token appended at the end.

5.  After the login is successful , the sessionid and the server URL values can be retrieved from the service.

Please find below the sequence diagram for the Salesforce Integration with .Net Application

6.  After the Authentication is complete , we can make a query (CRUDy calls) to the API using the sessionid and  server URL.

7. Now that the service is setup, a query (SOQL) can be made to Salesforce API. A Salesfoce Object Query Language(SOQL) is similar to the SQL query and behaviors.
8. Once the Statemnet is processed the Salesforce  API will return the query results as a Collection of Sobjects. We can also manipulate insert, update, upsert,delete,undelete operations.

9.  Also there are other methods on an instance of SforceService to Create ,Update,Delete,Upsert,Undelete
Thus SalesForce API is very robust.