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
Love SFDCLove SFDC 

Question on building Inbound webservice


I have requirement where an external application will invoke a webservice operation ( which we give through a WSDL) and salesforce has to return a set of records of an object, based on some criteria ( like today's records) they enter in the WSDL. Please let me know if this is doable. Thanks in advance.
KaranrajKaranraj
Yes you can implement that. Salesforce provides two type of WSDL 

Enterprise WSDL:
a) The Enterprise WSDL is strongly typed.
b) The Enterprise WSDL is tied (bound) to a specific configuration of Salesforce (ie. a specific organization's Salesforce configuration).
c) 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:
a) The Partner WSDL is loosely typed.
b) The Partner WSDL can be used to reflect against/interrogate any configuration of Salesforce (ie. any organization's Salesforce configuration).
c) The Partner WSDL is static, and hence does not change if modifications are made to an organization's Salesforce configuration.

For the reasons outlined above, the Partner WSDL is intended primarily for Partners.

To download a WSDL file when logged into Salesforce:

1. Click Setup | Customize | Develop | API 
2. Click the link to download the appropriate WSDL.
3. Save the file locally, giving the file a ".wsdl" extension.

You can also able to create custom apex webservice using @webservice annotations and extract as WSDL file
global class MyWebService {

    webService static List<Account>  makeContact(String lastName, Account a) {

   List<Account> lstAcct = [Select Id,Name from Account where CreatedbyDate =: Today()];
   //You have custom business logics here and then return the value 
   return lstAcct;

    }

}

Using these WSDL files external application have to generate the class and access the salesforce record.
Check this link for more details - https://developer.salesforce.com/page/Integration 

Thanks,
Karan
Love SFDCLove SFDC
Thanks Karan for the response ! 

I've couple of questions- 
1.External application users will invoke the webservice. They want to pull certain records with some filter critera ( like Today's Leads) which they've access to. I believe when you use Enterprise/Partner WSDL, the operations will be executed in system context. Right ? 

Is there a way that instead of the external user giving  a SOQL query pull out records with some filter criteria using Enterprise/Partner WSDL ? Or Should I go with custom inbound apex webservice class ?

Appreciate your help !