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.



More posts like this

Starfield visualization in JavaScript

󰃭 2024-08-31 | #canvas #javascript #programming-projects #tutorials

This is a simple, straightforward implementation of a visualization reminiscent of the classic Windows 95 starfield screensaver. It is also interactive: you can touch the screen or use the accelerometer to influence the direction of the movement. This is how it works: Create a bunch of particles (100), each in a random position. Every frame, move each particle further away from the center*. The further the particle is from the center, the more visible it will become.

Continue reading 


How to use Let's Encrypt certificates with Keycloak

󰃭 2023-01-04 | #java #keycloak #letsencrypt #linux #tips #tutorials

Keycloak provides user federation, strong authentication, user management, fine-grained authorization, and more. Here is a guide to enable HTTPS access to your Keycloak server using a free Let’s Encrypt SSL certificate. The beauty of Let’s Encrypt is its ease of use and the fact that it’s free! This guide assumes you have already installed Keycloak at /opt/keycloak/ using the official guide for bare metal installs, and now you want to enable HTTPS access.

Continue reading 