function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harish NarayananHarish Narayanan 

Importing partner.wsdl using WSC


I am trying to import the partner.wsdl in my java environment. I am using Mac OS X 10.10 and JDK 1.7 u60. I downloaded the WSC jar file from and using it to import the wsdl file. The jar file, wsdl file are in the current directory.
When I execute the following command, I get a bunch of error messages.

java -classpath force-wsc-33.0.1.jar partner.wsdl partner.jar

Exception in thread "main" java.lang.NoClassDefFoundError: org/stringtemplate/v4/STGroupDir
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(
    at java.lang.Class.getMethod0(
    at java.lang.Class.getMethod(
    at sun.launcher.LauncherHelper.getMainMethod(
    at sun.launcher.LauncherHelper.checkAndLoadMain(
Caused by: java.lang.ClassNotFoundException: org.stringtemplate.v4.STGroupDir
    at Method)
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    ... 6 more

When I googled, they point to issues in classpath, but I have referenced to the right classpath in my environment variable. 

<~/Downloads>echo ${CLASSPATH}


Could someone help me with this situation? Thanks.

Cyrus TalladenCyrus Talladen
I used this link to download the wsc tool

and followed jeff douglas' tutorial

and assuming your java command line is working properly then the line: 

java -cp ....   

should work since that's how I did it for a task I had.

Cyrus T
Harish NarayananHarish Narayanan
Thanks Cyrus. The google code link contains older version of wsc.jar. Though, I downloaded them and it worked, and now am able to generate the jar from the wsdl.

Does this mean the wsc jar file from has some issue in executing? Which is the primary source of the wsc and is it okay to use older wsc.jar files for wsdl files belonging to latest api version (33.0)?
Cyrus TalladenCyrus Talladen
You can try adding force-wsc as a dependency for your project in your IDE.  Both methods worked for me, and the basic SOAP functionality was there in both versions that I have tested.  I was able to send and receive decent-sized payloads through SOAP using the older versions as well. It may have been possible that force-wsc does not support some versions of java.