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
jeffersonjefferson 

Problems building WSC jar files from SalesForce enterprise WSDL

As specified in these instructions, I downloaded my organization's enterprise.wsdl file, downloaded wsc-23.jar from the Web Services Connector downloads page, and ran the following command from the directory containing the two downloaded files:

 

java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar

 which generated this output:

 

[WSC23][wsdlc.run:348]Created temp dir: C:\Users\myName\AppData\Local\Temp\wsdlc-temp-215798849-dir
[WSC23][wsdlc.<init>:110]Generating Java files from schema ...
[WSC23][wsdlc.<init>:110]Generated 290 java files.
[WSC23][wsdlc.compileTypes:298]Compiling to target default...
cannot find symbol
  symbol:   class RecordType
  location: package com.sforce.soap.enterprise.sobject
cannot find symbol
  symbol:   class RecordType
  location: package com.sforce.soap.enterprise.sobject
cannot find symbol
  symbol:   class RecordType
  location: package com.sforce.soap.enterprise.sobject
cannot find symbol
  symbol:   class RecordType
  location: package com.sforce.soap.enterprise.sobject
cannot find symbol
  symbol:   class RecordType
  location: package com.sforce.soap.enterprise.sobject
Error: Compilation failed

 

Why is class RecordType causing compilation to fail?

Salesforces - Java DeveloperSalesforces - Java Developer

Hi,

 

I  that you have to indicate the CLASSPATH even if you are running  the java command from the directory containing the two downloaded files.

 

For exemple if the files are dowloaded in the desktop, you commande must like this :

 

java -classpath D:\Users\MyComputerName\Desktop\wsc-23.jar com.sforce.ws.tools.wsdlc D:\Users\MyComputerName\Desktop\enterprise.wsdl enterprise.jar

 

PS : it is juste an exemple, You have to adapte it by replacing the text (conting my computer name) by your AbsolutePath.

jeffersonjefferson

Adding the full path produced the same result.

 

However, I may have found the root problem.  The WSDL contains a complexType called "Idea" which contains an element of type "ens:RecordType".  It looks like this:

 

<complexType name="Idea">
    <complexContent>
        <extension base="ens:sObject">
            <sequence>
		.
		.
		<element name="RecordType" nillable="true" minOccurs="0" type="ens:RecordType"/>
		.
		.
            </sequence>
        </extension>
    </complexContent>
</complexType>

 

However, the WSDL does not contain any definition of type RecordType.  In other words, there is no:

<complexType name="RecordType">

 

Is this the problem?  If so, why did SalesForce generate an invalid WSDL?