- First step is to get your salesforce.com security token, follow steps as described in Generating Security Token for SalesForce.com post for that
- Second step is to login into your salesforce.com account and download the Enterprise .wsdl, Follow steps 1-3 from Accessing SalesForce data using SOAP Service - SoapUi post for that
- You should use the Force.com web services connector (WSC) which has helper code that simplify working with Force.com SOAP service.
- Once you have WSC project downloaded on your machine and complied into jar copy it in a directory and then also copy your enterprise.wsdl in the same directory, then execute
It will generate enterprise.jar file for youjava -classpath target/force-wsc-29.0.0-jar-with-dependencies.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar
- Now create a Java Project and add both enterprise.jar and force-wsc-29.0.0-jar-with-dependencies.jar in your classpath
- Last step is to create SFDClient.java class like this Replace userId, password and securitytoken in this file with the values you have
- When you run the SFDClient.java class it will display list of contacts in your salesforce.com account
Using Salesforce SOAP API from Java Code
Recently i had to develop a portlet that talks to SalesForce.com and retrieves some data. I decided to use the SalesForce SOAP API for that, i followed these steps
Hi Sunil,
ReplyDeleteThe soap enterprise connector package is missing when I follow these steps. Can you let me know if it worked for you the first time?
Thanks
Raghu
Thanks for info....
ReplyDeleteWebsite development in Bangalore
Oh man! This blog is sick! How did you make it look like this !
ReplyDeleteP0wer bi onlinetraining from india