0

I am new to salesforce, hence this long post. I wanted to create a java app to do CRUD on salesforce. I have followed the rest api tutorial, and created app for fetching data from salesforce using REST(not bulk).

Now, for updating(records only), creating(custom objects), inserting(records) and deleting(records, and objects), I was looking into BULK api tutorial. I have some queries which I was not able to find documentation for:

  1. Can we not use soap and completely use rest to login. As per tutorial for bulk api, the code walkthrough has created connection using SOAP, and I tried using rest, but I am unable to create bulkConnnection on the same.
  2. What is the need of enterprise wsdl file. If I dont have enterprise wsdl file, can I still use bulk api for all the operations which it offers.
  3. In order to create tables(custom objects) and delete them, is it possible to do so using rest and not use meta api? Looking at it, it seems that meta api as well requires enterprise wsdl file.
  4. Is it possible to not create csv file for every job that is submitted, and instead have it loaded from java memory. I will be having row wise data in a List<list> java format, is it possible not to cause additional I/O by creating a temp csv file, and just push it to BULK writer. I was looking at com.sforce.async.ContentType and it only offers XML, JSON, CSV and zip support.
  5. For com.sforce.async.ContentType.JSON do I need to provide a Json file to write similar to a csv?

Thanks

PS. I will have to do it solely using java, and no SF app.

1

Can we not use soap and completely use rest to login. As per tutorial for bulk api, the code walkthrough has created connection using SOAP, and I tried using rest, but I am unable to create bulkConnnection on the same.

You can login using OAuth rather than SOAP login().

What is the need of enterprise wsdl file. If I dont have enterprise wsdl file, can I still use bulk api for all the operations which it offers.

You do not need the WSDL to use the Bulk API.

In order to create tables(custom objects) and delete them, is it possible to do so using rest and not use meta api? Looking at it, it seems that meta api as well requires enterprise wsdl file.

You cannot alter schema with the REST API. You must use the Metadata API to do so. You can choose to use the Metadata API as either a REST or a SOAP API, although the Metadata REST API does not have the CRUD calls present in the SOAP API; it is for deploying metadata ZIPs only.

Is it possible to not create csv file for every job that is submitted, and instead have it loaded from java memory. I will be having row wise data in a List java format, is it possible not to cause additional I/O by creating a temp csv file, and just push it to BULK writer. I was looking at com.sforce.async.ContentType and it only offers XML, JSON, CSV and zip support.

I do not write Java, but in Python it's certainly possible to stream data into an HTTP request in CSV format without writing it to disk. This has more to do with your language and network library than it does with Salesforce.

1
  • Thanks. So, do you keep the contentType in job to csv and stream the data while adding to batch? – NiharGht Aug 4 '20 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.