How Bulk API Works
Limits
Set Up Your Client Application
Walk Through the Sample Code
Map Data Fields
Bulk API End-of-Life Policy
Previous PDF Versions
The Bulk API uses HTTP GET and HTTP POST methods to send and receive XML or JSON content, so it’s simple to build clients in the language of your choice. This task uses a Java sample and the Salesforce Web Service Connector (WSC) toolkit provided by Salesforce to simplify development. WSC is a high-performing web service client stack implemented using a streaming parser. The toolkit has built-in support for the basic operations and objects used in the Bulk API.
Review the library here:
https://github.com/forcedotcom/wsc
To download the Salesforce WSC toolkit:
Browse to http://mvnrepository.com/artifact/com.force.api/force-wsc or https://repo1.maven.org/maven2/com/force/api/force-wsc/
Navigate to the version of WSC that matches the API version you’re using.
Click force-wsc-XX.X.X-uber.jar, and save the file to a local directory.
The Bulk API doesn’t provide a login operation, so you must use the SOAP API to login.
To download the partner WSDL and compile it to Java classes with the WSC toolkit:
Log in to your Developer Edition Salesforce account. You must log in as an administrator or as a user who has the “Modify All Data” permission. Logins are checked to ensure they are from a known IP address. For more information, see Security and the API in the SOAP API Developer Guide.
From Setup, in the Quick Find box, enter API, then select API.
Right-click Partner WSDL to display your browser’s save options, and save the partner WSDL to a local directory.
Compile the partner API code from the WSDL using the WSC compile tool:
1java -classpath pathToJar\force-wsc-XX.X.X-uber.jar com.sforce.ws.tools.wsdlc pathToWSDL\wsdlFilename .\wsdlGenFiles.jarFor example, if force-wsc-XX.X.X-uber.jar is installed in C:\salesforce\wsc, and the partner WSDL is saved to C:\salesforce\wsdl\partner:
1java -classpath C:\salesforce\wsc\force-wsc-XX.X.X-uber.jar com.sforce.ws.tools.wsdlc C:\salesforce\wsdl\partner\partner.wsdl .\partner.jarThe force-wsc-XX.X.X-uber.jar file and the generated partner.jar are the only libraries needed in the classpath for the code examples in the following sections.