Verify the WSDL Environment (WSDL-Based APIs)
You can verify your developer environment with a simple Java test application in Eclipse.
You should have the JDK, Eclipse, and WSC installed, and have generated the Java stub .jar files for the WSDL files that you need to use. You’ll need the stub .jar file for either the Enterprise or Partner WSDL to follow the verification steps.
-
Run Eclipse. Click File | New | Java Project and name the project SF-WSC-Test.
-
Add the WSC and stub .jar files to your project. Click Project | Properties | Java Build Path | Libraries, click Add External JARs, select the WSC, and stub .jar files, and click OK.
-
Add a new folder to the src folder by right-clicking src, then select New | Folder and use wsc as the folder name.
-
Create a new class by right-clicking wsc and selecting New | Class. Name the class
Main. -
Replace the code Eclipse generates for Main.java as described in the following section.
Use the following simple login example code for your Main.java class. Replace YOUR DEVORG USERNAME with your developer organization username, and replace YOUR DEVORG PASSWORD AND SECURITY TOKEN with your developer organization password appended with your security token. If you did not set a security token in your organization, just provide your password. A GitHub Gist of this code is available here: https://gist.github.com/anonymous/78864d2c4ccfe4e983ef.
The following example output shows a typical successful run of this code.
If the verification Java project runs and displays output that matches your organization, your developer environment is set up and you can start developing Java applications that integrate with Salesforce.