Compilation 从SalesForce企业WSDL构建WSC jar文件时出现问题

Compilation 从SalesForce企业WSDL构建WSC jar文件时出现问题,compilation,wsdl,salesforce,wsc,Compilation,Wsdl,Salesforce,Wsc,如中所述,我下载了组织的enterprise.wsdl文件,从中下载了wsc-23.jar,并从包含两个下载文件的目录中运行以下命令: java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar 生成此输出的是: [WSC23][wsdlc.run:348]Created temp dir: C:\Users\myName\AppData\Local\Temp\wsd lc-temp-2

如中所述,我下载了组织的
enterprise.wsdl
文件,从中下载了
wsc-23.jar
,并从包含两个下载文件的目录中运行以下命令:

java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc enterprise.wsdl enterprise.jar
生成此输出的是:

[WSC23][wsdlc.run:348]Created temp dir: C:\Users\myName\AppData\Local\Temp\wsd
lc-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
[WSC23][wsdlc.run:348]创建的临时目录:C:\Users\myName\AppData\Local\temp\wsd
lc-temp-215798849-dir
[WSC23][wsdlc.:110]正在从架构生成Java文件。。。
[WSC23][wsdlc.:110]生成了290个java文件。
[WSC23][wsdlc.compileType:298]正在编译到目标默认值。。。
找不到符号
符号:类记录类型
位置:包com.sforce.soap.enterprise.sobject
找不到符号
符号:类记录类型
位置:包com.sforce.soap.enterprise.sobject
找不到符号
符号:类记录类型
位置:包com.sforce.soap.enterprise.sobject
找不到符号
符号:类记录类型
位置:包com.sforce.soap.enterprise.sobject
找不到符号
符号:类记录类型
位置:包com.sforce.soap.enterprise.sobject
错误:编译失败

为什么类
RecordType
导致编译失败?

作为我们在上面评论中讨论的问题的解决方法,尝试手动将
RecordType
复杂类型添加到WSDL中。下面是它的外观:

<complexType name="RecordType">
    <complexContent>
        <extension base="ens:sObject">
            <sequence>
            <element name="BusinessProcessId" nillable="true" minOccurs="0" type="tns:ID"/>
            <element name="CreatedBy" nillable="true" minOccurs="0" type="ens:User"/>
            <element name="CreatedById" nillable="true" minOccurs="0" type="tns:ID"/>
            <element name="CreatedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/>
            <element name="Description" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="DeveloperName" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="IsActive" nillable="true" minOccurs="0" type="xsd:boolean"/>
            <element name="IsPersonType" nillable="true" minOccurs="0" type="xsd:boolean"/>
            <element name="LastModifiedBy" nillable="true" minOccurs="0" type="ens:User"/>
            <element name="LastModifiedById" nillable="true" minOccurs="0" type="tns:ID"/>
            <element name="LastModifiedDate" nillable="true" minOccurs="0" type="xsd:dateTime"/>
            <element name="Localization" nillable="true" minOccurs="0" type="tns:QueryResult"/>
            <element name="Name" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="NamespacePrefix" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="SobjectType" nillable="true" minOccurs="0" type="xsd:string"/>
            <element name="SystemModstamp" nillable="true" minOccurs="0" type="xsd:dateTime"/>
            </sequence>
        </extension>
    </complexContent>
</complexType>


正如我上面提到的,这听起来像是WSDL生成中的一个bug,因此我建议您也向SFDC支持提交一份票据。

您能确认您的WSDL中有
?我认为这可能是一个可见性问题,其他对象正在查找RecordType,但您的WSDL中没有RecordType本身。@ryanbrainard不,WSDL中不存在这种复杂类型。那么SalesForce是否为我的组织生成了一个糟糕的WSDL?这是可能的。我只是尝试从WSDL中删除元素中的
,并重现了相同的问题。你用的是专业版吗?可能有一个bug不是由于PE缺少记录类型造成的??我建议您向SFDC支持部门提交一个问题。我正在与SFDC合作以解决此问题,您的解决方法暂时有效。谢谢