Category Archives: Uncategorized

Salesforce Development with Java: Generating Java Stub Files

I’m wondering if there aren’t many people in the world like me, who sometimes solve Salesforce problems using Java console apps, but aren’t really “Java developers.” I’ve used Java for such things over the past few years because I can use it without expensive IDE licenses (in other words, I don’t have to buy a full license of Visual Studio or fight with lesser tools using C#). Java is enough like Apex that I’m comfortable enough with it, and there’s lots that can be Googled to get value out of the Salesforce SOAP, metadata, and tooling APIs using Java. That said, every so often, I find myself at a new job, or needing to upgrade, and I have a HORRIBLE time figuring out how to generate Java stub files from the Salesforce WSDLs and the Salesforce Web Services Connector (WSC). I’m going to try to write up what I just did this time around so 1) I’ll have the steps for myself the next time I find myself trying to figure this out, and 2) hopefully someone else in the world will get some use out of this. Here goes…

  1. Go straight to Maven Repository for the “Force WSC” project and pick up the latest uber binary for the WSC.
    • PLEASE NOTE: Make sure you get the uber binary. To do that:
      1. Click the API number in the “Version” column, which is a link. You’ll probably want the one at the top, which should be the most current API version available.
      2. On the revealed page, look for the “Files” row in the table toward the top, and click “View All.”
      3. In the long list of files, find the one with a name like: force-wsc-51.0.0-uber.jar
        • The numbers in the filename will reflect the API version of the binary selected above.
  2. Put that jar, and the WSDL file you generated from Salesforce (if you need help with that, just Google it; lots of people have written up how to generate the WSDL), into the same directory.
  3. Open that directory in a command line tool (I use Git Bash or PowerShell, but use what you’re comfortable with).
  4. Run the WSC jar / build your stub file.
    • You’re going to see lots of syntax for this all over the Internet. You’ll see blogs referencing a need to have various dependencies downloaded and included in your classpath when you try to run the jar (StringTemplate, Rhino, etc.). I think the developers making the WSC are, these days, including everything you need in the “uber” WSC jar. So, try this syntax (update the API version and file names):
java -classpath .\force-wsc-51.0.0-uber.jar com.sforce.ws.tools.wsdlc .\wsdl.jsp.xml .\partner.jar

That worked for me. I’m hoping this helps other Salesforce developers with “beginner-to-intermediate” Java skills like me to figure this out.

Screenshot 1: The Maven Repository view where you click the API number link…
Screenshot 2: The Maven Respository view where you click “View All” in the “Files” row to find the “uber” jar…
Screenshot 3: The list of downloadable binaries…

Reboot: Or, How to End a Blogging Hiatus…

Well, my grand experiment around a professional blog clearly stalled, but I think I’ve got a pretty good reason.  I was hired as a Salesforce Architect for a great company, ACI Worldwide, in November 2014.  I just had my one year anniversary.  It has been an INTENSE year.  We have covered a lot of ground, including:

  • Standing up a third-party Salesforce backup solution (Backupify) in the cloud
  • Migrating data from a Salesforce instance owned by a company ACI acquired into ACI’s Salesforce instance
  • Rolling out a new deployment process (which is still evolving)
  • Studying new integration strategies around a pending move of a back end system from on premise (Oracle 11i) to the cloud (Oracle Fusion).
  • Designing several new solutions on the Salesforce Platform.

I’m going to try to make an effort to start my mornings blogging about some of the experiences I’ve had in the past year as the technical lead of this remarkable Salesforce development team I’ve been privileged to join.  For now, suffice it to say it’s been an amazing year, and it looks like we’ve got some cool things on the horizon as well!

Testing the Blog

OK, I’m not exactly sure how this thing is going to work, but I want to start blogging, so here I go.  I’m thinking this will be a way for me to journal in a way that friends and colleagues can see, if they like.  I also think it will help me create an online identity, or “brand,” that extends beyond just what users can find about me on Facebook and such.

I’d like my blog to be meaningful.  I’d like it to encompass what I learn along the way in the course of doing my job and my supplemental study of  software development.  I figure I’ve got something worthwhile to share with the world in sharing myself.  So, here’s where it begins.

Continue reading Testing the Blog