1

I need to add data, specifically a lead, to another organization's Salesforce account. I need to use the SOAP API from an external .NET web application.

In my prototypes I have the Enterprise WSDL in my Visual Studio project and I can successfully add a lead to my organization's Salesforce account, authenticating with my email address and password/security token combination.

However, I need to insert a lead into another organization's Salesforce account. The configuration (email, password, token etc) will be stored in the external .NET application, but the part I am struggling to understand is:

I have the Enterprise WSDL which is strongly typed to my organization's Salesforce account, so I cannot use that to make calls on another organization's Salesforce data, even if I have the credentials, correct?

This is how I am currently adding a lead to our Salesforce account

private SforceService binding;
binding = new SforceService();
binding.Timeout = 10000;
LoginResult lr = null;
bool success = true;

try
{
    lr = binding.login("myemailaddress", "mypasswordandtoken");
}
catch (Exception ex)
{
     success = false;
}
if(success)
{
    // snip, newLead is created here.
    SaveResult[] sr = binding.create(new sObject[] { newLead });
}
0

1 Answer 1

2

You would use the partner WSDL to connect and update records in the other orgs:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_partner_objects.htm

With the partner WSDL, your client application code handles fields as arrays of name-value pairs that represent the field data. When referring to the name of an individual field, use the value in its name field of the Field type in the DescribeSObjectResult

https://help.salesforce.com/apex/HTViewSolution?id=000004760&language=en_US

Salesforce provides a WSDL (Web Service Description Language) files. They are called "Enterprise WSDL" and "Partner WSDL". A WSDL is an XML-document which contains a standardized description on how to communicate using a web service (the Salesforce API is exposed as a web service). The WSDL is used by developers to aid in the creation of Salesforce integration pieces. A typical process involves using the Development Environment (eg, Eclipse for Java, or Visual Studio for .Net) to consume the WSDL, and generate classes which are then referenced in the integration.

Enterprise WSDL:

The Enterprise WSDL is strongly typed.

  • The Enterprise WSDL is tied (bound) to a specific configuration of Salesforce (ie. a specific organization's Salesforce configuration).
  • The Enterprise WSDL changes if modifications (e.g custom fields or custom objects) are made to an organization's Salesforce
    configuration.

For the reasons outlined above, the Enterprise WSDL is intended primarily for Customers.

Partner WSDL:

  • The Partner WSDL is loosely typed.
  • The Partner WSDL can be used to reflect against/interrogate any configuration of Salesforce (ie. any organization's Salesforce configuration).
  • The Partner WSDL is static, and hence does not change if modifications are made to an organization's Salesforce configuration.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .