Generating partner.jar for Salesforce API Integration
2014-11-12
I ran into a small issue recently when setting up a Java project to use the Salesforce APIs.
Basically, you need to download a WSDL file from Salesforce, then use a tool made by them to generate a jar that you then include in your Java program.
They instruct you to download force-wsc.jar
and then run it, but when
you run it you realize they didn’t pack the dependencies within the jar!
To solve this problem, you need to download the following jars:
And then run force-wsc.jar
, including the dependencies in the classpath:
$ java -classpath force-wsc-32.1.1.jar:js-1.7R2.jar:ST-4.0.7.jar \
com.sforce.ws.tools.wsdlc partner.wsdl partner-32.1.1.jar
Please note these were the versions that worked for me. If your force-wsc.jar
is
a different version, check if you need to include other version of its dependencies.