Install WSDL2Apex on OS X El Capitan
The WSDL2Apex generates the Apex classes necessary to implement a SOAP callout from the Force.com platform using the WSDL for the service you are trying to implement. In 2014 it was split out of the Force.com IDE codebase and was made open source , available on it’s own as an open source project.
This means that you can clone the GitHub project, build the JAR, and then use it to consume a WSDL and generate your Apex classes. There is one caveat for OS X El Capitan (and Yosemite as well) in that the operating system ships with Java 1.8, however WSDL2Apex requires Java 1.7 or earlier. If you try to run the build using a later version of Java, you will get 12-15 test errors (I got 12, other people reported 15).
Results : Failed tests: testAsyncFalse(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test 8 doesn't match expected:<...rmationByAirportCode[Response_element {(..) testNewClassNames(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): testNewClassNames doesn't match expected:<... }(..) testNoOperation(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test noOperation failed expected:<... public class Echo[Date_element {(..) testExchange(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test testExchange failed expected:<...{(..) testAmazonGood(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test testAmazonGood failed expected:<... {(..) testBigFile(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test testBigFile failed expected:<... {(..) testNamespaceDependencies(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test testNamespaceDependencies failed expected:<... {(..) testTwoNamespaces(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): testTwoNamespaces a doesn't match, Async class expected:<...mple.com/stockquote.[wsdl', 'exampleComStockquoteWsdl', 'http://example.com/stockquote.xsd', 'exampleComStockquoteXsd]'};(..) testSqlMutations(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test sqlMutations failed expected:<...lic class getMutants[CompressedResponse_element {(..) testMultipleNamespace(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): Test testMultipleNamespace failed expected:<... public class Echo[Date_element {(..) testLargeFile(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): testLargeFile a doesn't match expected:<...m/spectrum/services/[EOLS_PSAPLookupUS', 'wwwPbComSpectrumServicesEolsPsaplo', 'http://spectrum.pb.com/', 'spectrumPbCom', 'http://www.mapinfo.com/midev/service/geometries/v1', 'wwwMapinfoComMidevServiceGeometries', 'http://www.mapinfo.com/midev/service/units/v1', 'wwwMapinfoComMidevServiceUnitsV1', 'http://www.pb.com/spectrum/services/', 'wwwPbComSpectrumServic]es'};(..) testSimple(com.salesforce.ide.wsdl2apex.core.WSDL2ApexTest): testSimple doesn't match expected:<...rmationByAirportCode[Response_element {(..) Tests run: 47, Failures: 12, Errors: 0, Skipped: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.230 s [INFO] Finished at: 2015-11-23T20:30:10-08:00 [INFO] Final Memory: 8M/245M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project WSDL2Apex: There are test failures.
Requirements
- Homebrew
- git
- Apache Maven
- Java 1.6
We’ll use Homebrew to install git (to fetch the project), Apache Maven (to build the project), and Java 1.6 from Apple to meet the version requirements.
Homebrew, Git, and Maven
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" brew install maven git
Clone WSDL2Apex
mkdir ~/SalesforceDev && cd ~/SalesforceDev git clone https://github.com/forcedotcom/WSDL2Apex cd WSDL2Apex
Java 1.6 for OS X
Visit the Apple support site to download and install Java 1.6 for OS X. It will be installed to your /Library/Java/JavaVirtualMachines/1.6.0.jdk/
directory.
Build WSDL2Apex
We need to set the JAVA_HOME
directory to point to the 1.6 JDK so that Maven will use it for the build. To do this just set it before the actual mvn
execution. If you have Java 1.7 on your machine, feel free to substitute it for 1.6 – just check your JavaVirtualMachines
directory to see what’s available.
JAVA_HOME=/Library/Java/JavaVirtualMachines/j1.6.0.jdk/Contents/Home/ \ mvn install package
Bask in the glory that are your newly generated Apex SOAP classes.
Thanks Justin, very helpful article, this helped me get my project up and running. A couple of links that others may find useful:
– Page to download the Legacy Java 6 runtime (though I found this to be unnecessary since 1.7 is fine, as you mentioned in the post): https://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US
– A shell function I use to make switching between JDKs easy: http://superuser.com/questions/490425/how-do-i-switch-between-java-7-and-java-6-on-os-x-10-8-2/568016#568016
Thanks again!
Hi Justin, Not related to WSDL2APEX, but have you had any luck installing the Force.com IDE on El Capitan?
SFDC support is declaring it as unsupported.
I’m not totally sure (I’ve been using Sublime Text + MavensMate or http://aside.io lately) but since it’s based on Eclipse I would think you could get it to work. Likely it’s the version of Java that ships with El Capitan, so installing the same version as is in this post and making sure to use it to start the IDE should work. Good luck!
Kevin, have you tried the Illuminated Cloud plugin for IntelliJ? It’s another alternative to the Force.com IDE that won’t require you to use an older version of Java. Very well maintained and it works much better than the Force.com IDE, IMO. Lots of info at http://www.illuminatedcloud.com/, good luck!