SlideShare une entreprise Scribd logo
1  sur  28
By Forcetree.com




   Copyright Forcetree.com
 It is assumed that you have very little programming
  knowledge in JAVA and APEX for salesforce.com, or
  the other SOFTWARES used in the process.
 This guide is intended to give you a step by step
  procedure to write a simple JAVA program and connect
  to Salesforce.com.
 This guide should approximately take 1 to 2 hours or
  less to complete.



                        Copyright Forcetree.com
 Go to




          Copyright Forcetree.com
Copyright Forcetree.com
Copyright Forcetree.com
Copyright Forcetree.com
Copyright Forcetree.com
 Install the Force.com plugin for ECLIPSE (optional)
 Even though it’s optional, it’s highly recommended
 that you do this step. Your future developments would
 be dependent on this plugin




                        Copyright Forcetree.com
 Follow the instructions as listed in the below URL




                        Copyright Forcetree.com
Courtesy :




Download the latest version of Apache Axis
from




                     Copyright Forcetree.com
Copyright Forcetree.com
Copyright Forcetree.com
 Download the ZIP file
 Extract the ZIP file and save as C:axis-1_4
 Download the following files
 Activation.jar


 Mail.jar


 Xmlsec.jar


   Extract these 3 supporting libraries and copy
    the .jar files to the lib folder inside the WEB-
    INF folder of your Axis installation folder. (image
    shown in next slide)


                           Copyright Forcetree.com
Copyright Forcetree.com
 Copy “activation.jar” and “mail.jar” and paste it into
  the location shown below. Also, verify that the
  contents of the location shown below is the same for
  you.




                         Copyright Forcetree.com
 Copy the axis folder inside the webapps folder of the
 Axis distribution folder, to your Apache
 Tomcat webapps folder. (as in the images shown
 below)




                        Copyright Forcetree.com
Copyright Forcetree.com
 Set the following path variables. Refer Slide 6 if you are
  unsure how to set path variables.




                         Copyright Forcetree.com
 AXIS_HOME = C:axis-1_4
 AXIS_LIB = %AXIS_HOME%lib
 AXISCLASSPATH =
  %AXIS_LIB%axis.jar;%AXIS_LIB%commons-discovery-
  0.2.jar;%AXIS_LIB%commons-logging-
  1.0.4.jar;%AXIS_LIB%jaxrpc.jar;%AXIS_LIB%saaj.jar;%A
  XIS_LIB%log4j-1.2.8.jar;%AXIS_LIB%xml-
  apis.jar;%AXIS_LIB%xercesImpl.jar;%AXIS_LIB%wsdl4j-
  1.5.1.jar
 CLASSPATH = C:Program
  FilesJavajdk1.7.0_02bin;C:Program
  FilesJavajdk1.7.0_02jrebin;C:axis-1_4;C:axis-
  1_4libwsdl4j-1.5.1.jar;C:axis-1_4libmail.jar;C:axis-
  1_4libactivation.jar;C:axis-1_4libsaaj.jar;C:axis-
  1_4liblog4j-1.2.8.jar;C:axis-1_4libjaxrpc.jar;C:axis-
  1_4libcommons-logging-1.0.4.jar;C:axis-
  1_4libcommons-discovery-0.2.jar;C:axis-
  1_4libaxis.jar;C:axis-1_4libaxis-ant.jar
                          Copyright Forcetree.com
 Start your Apache Tomcat or restart it if you've got it running.
 Access http://localhost:8080/axis. If you see the result like below
  this, it means you have installed Apache Axis successfully. You can also
  click the Validation link to check if your Axis' installation
  configuration is fine.




                                Copyright Forcetree.com
The steps in this video are explained in the slides below.
Youtube URL: http://www.youtube.com/watch?v=tK2CiLb5vgc

Go to the next slide to play the video




                                    Copyright Forcetree.com
 Download the “Enterprise WSDL” as shown in the video.
 Create a folder on your desktop called “demo2”. Create a folder inside
  “demo2” called “Downloads”. Paste the “enterprise.wsdl.xml” file into
  the “Downloads” folder.




                                Copyright Forcetree.com
 Go to the command prompt and execute the following command.
 C:Users436321Desktopdemo2>java org.apache.axis.wsdl.WSDL2Java -a
  c:Users436321desktopdemo2downloadsenterprise.wsdl.xml




                               Copyright Forcetree.com
 After you execute the command, a new folder called
  “com” would be created inside your “demo2” folder.




 Start “eclipse”.
 Follow the steps outlined in the video in the next slide.
  The JAVA program source code is also provided after
  the video.

                         Copyright Forcetree.com
Go to the next slide to play the video

Youtube URL: http://www.youtube.com/watch?v=gAx0XVgne3w




                                 Copyright Forcetree.com
   import com.sforce.soap.enterprise.LoginResult;
   import com.sforce.soap.enterprise.QueryResult;
   import com.sforce.soap.enterprise.SessionHeader;
   import com.sforce.soap.enterprise.SforceServiceLocator;
   import com.sforce.soap.enterprise.SoapBindingStub;
   import com.sforce.soap.enterprise.sobject.Contact;



   public class RunDemo {
   private static final String USERNAME = “provide username here";
   private static final String TOKEN = “provide token here";
   private static final String PASSWORD = “provide password here" + TOKEN;
   private SoapBindingStub binding;
   public static void main(String[] args) {
              RunDemo d = new RunDemo();
              try {
                             d.login();
              } catch (Exception e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
              }
              try {
                             d.search();
              } catch (Exception e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
              }
   }                                                Copyright Forcetree.com
   private void login() throws Exception{
             binding = (SoapBindingStub) new SforceServiceLocator().getSoap();
             LoginResult loginResult = binding.login(USERNAME, PASSWORD);

             binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());
             SessionHeader sh = new SessionHeader();
             sh.setSessionId(loginResult.getSessionId());
             binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader",sh);

   }
   private void search() throws Exception{
             QueryResult qr=binding.query("Select FirstName, LastName from Contact");
             if (qr.getSize() > 0)
                             for (int i=0; i<qr.getSize(); i++){
                                             Contact c = (Contact) qr.getRecords(i);
                                             System.err.println(c.getFirstName() +" "+ c.getLastName() );

                           }

   }

   }




                                                      Copyright Forcetree.com
Like us at: Forcetree.com - Facebook page
Visit us at: Forcetree.com
                                 Copyright Forcetree.com

Contenu connexe

Tendances

Sead 29 09 2006 Usabilidade Com Ajax
Sead 29 09 2006 Usabilidade Com AjaxSead 29 09 2006 Usabilidade Com Ajax
Sead 29 09 2006 Usabilidade Com AjaxMilfont Consulting
 
Error xaction etl_ktr
Error xaction etl_ktrError xaction etl_ktr
Error xaction etl_ktrhurac
 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum
 
Retrofit 2 - O que devemos saber
Retrofit 2 - O que devemos saberRetrofit 2 - O que devemos saber
Retrofit 2 - O que devemos saberBruno Vieira
 
Crushing React bugs with Jest and Enzyme
Crushing React bugs with Jest and EnzymeCrushing React bugs with Jest and Enzyme
Crushing React bugs with Jest and EnzymeAll Things Open
 
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)Tech in Asia ID
 
Supporting Debian machines for friends and family
Supporting Debian machines for friends and familySupporting Debian machines for friends and family
Supporting Debian machines for friends and familyFrancois Marier
 
Easy logins for Ruby web applications
Easy logins for Ruby web applicationsEasy logins for Ruby web applications
Easy logins for Ruby web applicationsFrancois Marier
 
Stacki: Remove Commands
Stacki: Remove CommandsStacki: Remove Commands
Stacki: Remove CommandsStackIQ
 
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps_Fest
 

Tendances (14)

Sead 29 09 2006 Usabilidade Com Ajax
Sead 29 09 2006 Usabilidade Com AjaxSead 29 09 2006 Usabilidade Com Ajax
Sead 29 09 2006 Usabilidade Com Ajax
 
Error xaction etl_ktr
Error xaction etl_ktrError xaction etl_ktr
Error xaction etl_ktr
 
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
 
Flask SQLAlchemy
Flask SQLAlchemy Flask SQLAlchemy
Flask SQLAlchemy
 
Retrofit 2 - O que devemos saber
Retrofit 2 - O que devemos saberRetrofit 2 - O que devemos saber
Retrofit 2 - O que devemos saber
 
Crushing React bugs with Jest and Enzyme
Crushing React bugs with Jest and EnzymeCrushing React bugs with Jest and Enzyme
Crushing React bugs with Jest and Enzyme
 
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
"Less Painful iOS Development" by Samuel Edwin (Tokopedia)
 
AssertJ quick introduction
AssertJ quick introductionAssertJ quick introduction
AssertJ quick introduction
 
Supporting Debian machines for friends and family
Supporting Debian machines for friends and familySupporting Debian machines for friends and family
Supporting Debian machines for friends and family
 
Easy logins for Ruby web applications
Easy logins for Ruby web applicationsEasy logins for Ruby web applications
Easy logins for Ruby web applications
 
Stacki: Remove Commands
Stacki: Remove CommandsStacki: Remove Commands
Stacki: Remove Commands
 
Agile Android
Agile AndroidAgile Android
Agile Android
 
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing EventsDevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
DevOps Fest 2020. Philipp Krenn. Scale Your Auditing Events
 
Flask Basics
Flask BasicsFlask Basics
Flask Basics
 

Similaire à Forcetree.com writing a java program to connect to sfdc

Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and FriendsYun Zhi Lin
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressJeroen van Dijk
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gearsdion
 
Inversion Of Control
Inversion Of ControlInversion Of Control
Inversion Of Controlbhochhi
 
LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in detailsMax Klymyshyn
 
Learning Java 4 – Swing, SQL, and Security API
Learning Java 4 – Swing, SQL, and Security APILearning Java 4 – Swing, SQL, and Security API
Learning Java 4 – Swing, SQL, and Security APIcaswenson
 
Flash Security, OWASP Chennai
Flash Security, OWASP ChennaiFlash Security, OWASP Chennai
Flash Security, OWASP Chennailavakumark
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third PluginJustin Ryan
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesPavol Pitoňák
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Davide Cerbo
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming Enguest9bcef2f
 
Writing JavaScript that doesn't suck
Writing JavaScript that doesn't suckWriting JavaScript that doesn't suck
Writing JavaScript that doesn't suckRoss Bruniges
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিFaysal Shahi
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleThierry Wasylczenko
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyonddion
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008Volkan Unsal
 
Integrating Force.com with Heroku
Integrating Force.com with HerokuIntegrating Force.com with Heroku
Integrating Force.com with HerokuPat Patterson
 
Creating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantCreating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantArtefactual Systems - AtoM
 

Similaire à Forcetree.com writing a java program to connect to sfdc (20)

Dropwizard and Friends
Dropwizard and FriendsDropwizard and Friends
Dropwizard and Friends
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
Future of Web Apps: Google Gears
Future of Web Apps: Google GearsFuture of Web Apps: Google Gears
Future of Web Apps: Google Gears
 
Inversion Of Control
Inversion Of ControlInversion Of Control
Inversion Of Control
 
LvivPy - Flask in details
LvivPy - Flask in detailsLvivPy - Flask in details
LvivPy - Flask in details
 
Learning Java 4 – Swing, SQL, and Security API
Learning Java 4 – Swing, SQL, and Security APILearning Java 4 – Swing, SQL, and Security API
Learning Java 4 – Swing, SQL, and Security API
 
Flash Security, OWASP Chennai
Flash Security, OWASP ChennaiFlash Security, OWASP Chennai
Flash Security, OWASP Chennai
 
Demystifying Maven
Demystifying MavenDemystifying Maven
Demystifying Maven
 
Writing your Third Plugin
Writing your Third PluginWriting your Third Plugin
Writing your Third Plugin
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
Non Conventional Android Programming (English)
Non Conventional Android Programming (English)Non Conventional Android Programming (English)
Non Conventional Android Programming (English)
 
Non Conventional Android Programming En
Non Conventional Android Programming EnNon Conventional Android Programming En
Non Conventional Android Programming En
 
Writing JavaScript that doesn't suck
Writing JavaScript that doesn't suckWriting JavaScript that doesn't suck
Writing JavaScript that doesn't suck
 
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটিWordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
WordPress Security - ওয়ার্ডপ্রেসের সিকিউরিটি
 
Construire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradleConstruire une application JavaFX 8 avec gradle
Construire une application JavaFX 8 avec gradle
 
Google Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and BeyondGoogle Back To Front: From Gears to App Engine and Beyond
Google Back To Front: From Gears to App Engine and Beyond
 
Widget Summit 2008
Widget Summit 2008Widget Summit 2008
Widget Summit 2008
 
Integrating Force.com with Heroku
Integrating Force.com with HerokuIntegrating Force.com with Heroku
Integrating Force.com with Heroku
 
Creating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with VagrantCreating your own AtoM demo data set for re-use with Vagrant
Creating your own AtoM demo data set for re-use with Vagrant
 

Dernier

Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 

Dernier (20)

Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 

Forcetree.com writing a java program to connect to sfdc

  • 1. By Forcetree.com Copyright Forcetree.com
  • 2.  It is assumed that you have very little programming knowledge in JAVA and APEX for salesforce.com, or the other SOFTWARES used in the process.  This guide is intended to give you a step by step procedure to write a simple JAVA program and connect to Salesforce.com.  This guide should approximately take 1 to 2 hours or less to complete. Copyright Forcetree.com
  • 3.  Go to Copyright Forcetree.com
  • 8.  Install the Force.com plugin for ECLIPSE (optional)  Even though it’s optional, it’s highly recommended that you do this step. Your future developments would be dependent on this plugin Copyright Forcetree.com
  • 9.  Follow the instructions as listed in the below URL Copyright Forcetree.com
  • 10. Courtesy : Download the latest version of Apache Axis from Copyright Forcetree.com
  • 13.  Download the ZIP file  Extract the ZIP file and save as C:axis-1_4  Download the following files  Activation.jar  Mail.jar  Xmlsec.jar  Extract these 3 supporting libraries and copy the .jar files to the lib folder inside the WEB- INF folder of your Axis installation folder. (image shown in next slide) Copyright Forcetree.com
  • 15.  Copy “activation.jar” and “mail.jar” and paste it into the location shown below. Also, verify that the contents of the location shown below is the same for you. Copyright Forcetree.com
  • 16.  Copy the axis folder inside the webapps folder of the Axis distribution folder, to your Apache Tomcat webapps folder. (as in the images shown below) Copyright Forcetree.com
  • 18.  Set the following path variables. Refer Slide 6 if you are unsure how to set path variables. Copyright Forcetree.com
  • 19.  AXIS_HOME = C:axis-1_4  AXIS_LIB = %AXIS_HOME%lib  AXISCLASSPATH = %AXIS_LIB%axis.jar;%AXIS_LIB%commons-discovery- 0.2.jar;%AXIS_LIB%commons-logging- 1.0.4.jar;%AXIS_LIB%jaxrpc.jar;%AXIS_LIB%saaj.jar;%A XIS_LIB%log4j-1.2.8.jar;%AXIS_LIB%xml- apis.jar;%AXIS_LIB%xercesImpl.jar;%AXIS_LIB%wsdl4j- 1.5.1.jar  CLASSPATH = C:Program FilesJavajdk1.7.0_02bin;C:Program FilesJavajdk1.7.0_02jrebin;C:axis-1_4;C:axis- 1_4libwsdl4j-1.5.1.jar;C:axis-1_4libmail.jar;C:axis- 1_4libactivation.jar;C:axis-1_4libsaaj.jar;C:axis- 1_4liblog4j-1.2.8.jar;C:axis-1_4libjaxrpc.jar;C:axis- 1_4libcommons-logging-1.0.4.jar;C:axis- 1_4libcommons-discovery-0.2.jar;C:axis- 1_4libaxis.jar;C:axis-1_4libaxis-ant.jar Copyright Forcetree.com
  • 20.  Start your Apache Tomcat or restart it if you've got it running.  Access http://localhost:8080/axis. If you see the result like below this, it means you have installed Apache Axis successfully. You can also click the Validation link to check if your Axis' installation configuration is fine. Copyright Forcetree.com
  • 21. The steps in this video are explained in the slides below. Youtube URL: http://www.youtube.com/watch?v=tK2CiLb5vgc Go to the next slide to play the video Copyright Forcetree.com
  • 22.  Download the “Enterprise WSDL” as shown in the video.  Create a folder on your desktop called “demo2”. Create a folder inside “demo2” called “Downloads”. Paste the “enterprise.wsdl.xml” file into the “Downloads” folder. Copyright Forcetree.com
  • 23.  Go to the command prompt and execute the following command.  C:Users436321Desktopdemo2>java org.apache.axis.wsdl.WSDL2Java -a c:Users436321desktopdemo2downloadsenterprise.wsdl.xml Copyright Forcetree.com
  • 24.  After you execute the command, a new folder called “com” would be created inside your “demo2” folder.  Start “eclipse”.  Follow the steps outlined in the video in the next slide. The JAVA program source code is also provided after the video. Copyright Forcetree.com
  • 25. Go to the next slide to play the video Youtube URL: http://www.youtube.com/watch?v=gAx0XVgne3w Copyright Forcetree.com
  • 26. import com.sforce.soap.enterprise.LoginResult;  import com.sforce.soap.enterprise.QueryResult;  import com.sforce.soap.enterprise.SessionHeader;  import com.sforce.soap.enterprise.SforceServiceLocator;  import com.sforce.soap.enterprise.SoapBindingStub;  import com.sforce.soap.enterprise.sobject.Contact;  public class RunDemo {  private static final String USERNAME = “provide username here";  private static final String TOKEN = “provide token here";  private static final String PASSWORD = “provide password here" + TOKEN;  private SoapBindingStub binding;  public static void main(String[] args) {  RunDemo d = new RunDemo();  try {  d.login();  } catch (Exception e) {  // TODO Auto-generated catch block  e.printStackTrace();  }  try {  d.search();  } catch (Exception e) {  // TODO Auto-generated catch block  e.printStackTrace();  }  } Copyright Forcetree.com
  • 27. private void login() throws Exception{  binding = (SoapBindingStub) new SforceServiceLocator().getSoap();  LoginResult loginResult = binding.login(USERNAME, PASSWORD);   binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());  SessionHeader sh = new SessionHeader();  sh.setSessionId(loginResult.getSessionId());  binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(),"SessionHeader",sh);   }  private void search() throws Exception{  QueryResult qr=binding.query("Select FirstName, LastName from Contact");  if (qr.getSize() > 0)  for (int i=0; i<qr.getSize(); i++){  Contact c = (Contact) qr.getRecords(i);  System.err.println(c.getFirstName() +" "+ c.getLastName() );   }   }  } Copyright Forcetree.com
  • 28. Like us at: Forcetree.com - Facebook page Visit us at: Forcetree.com Copyright Forcetree.com