1

I am trying to generate jar file for apex SOAP web service through terminal with command -

java -classpath force-wsc-40.1.1.jar;ST-4.0.1.jar;antlr-runtime-3.4_2.jar;tools.jar com.sforce.ws.tools.wsdlc AccountManagerSOAPService_wsdl.xml AccountManager.jar

But I am getting error -

C:\Users\Rohit\wsc-scratch6350799437671588252tmp\com\sforce\soap\AccountManagerSOAPService\EntityParticle.java:1496: error: cannot find symbol setReferenceTo((com.sforce.soap.AccountManagerSOAPService.RelationshipReferenceTo)__typeMapper.readObject(__in, _lookupTypeInfo("ReferenceTo", "http://soap.sforce.com/schemas/class/memb/Accoun tManagerSOAPService","ReferenceTo","http://soap.sforce.com/schemas/class/memb/AccountManagerSOAPService","RelationshipReferenceTo",0,1,true), com.sforce.soap.AccountManagerSOAPService.RelationshipRefe renceTo.class));

Why do I get this error? How can I fix it?

3
  • 2
    Might be related to this known issue Generated WSDL for Apex webservices is malformed where the workaround is to manually add some types into the WSDL before you do the code generation.
    – Keith C
    Commented Jul 11, 2017 at 7:38
  • Thanks a lot @KeithC, the link shared by you helped me in fixing this issue. Commented Jul 11, 2017 at 8:38
  • Cool; you should be able to accept your own answer in a day or two.
    – Keith C
    Commented Jul 11, 2017 at 8:51

1 Answer 1

2

After adding below mentioned definition to

<xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/<className>/<webserviceName>"> 

tag in web service WSDL file,I am able to generate jar file.

<xsd:complexType name="SearchLayoutButtonsDisplayed"> 
<xsd:sequence> 
<xsd:element name="applicable" type="xsd:boolean"/> 
<xsd:element name="buttons" minOccurs="0" maxOccurs="unbounded" type="tns:SearchLayoutButton"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="SearchLayoutButton"> 
<xsd:sequence> 
<xsd:element name="apiName" type="xsd:string"/> 
<xsd:element name="label" type="xsd:string"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="SearchLayoutFieldsDisplayed"> 
<xsd:sequence> 
<xsd:element name="applicable" type="xsd:boolean"/> 
<xsd:element name="fields" minOccurs="0" maxOccurs="unbounded" type="tns:SearchLayoutField"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="SearchLayoutField"> 
<xsd:sequence> 
<xsd:element name="apiName" type="xsd:string"/> 
<xsd:element name="label" type="xsd:string"/> 
<xsd:element name="sortable" type="xsd:boolean"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="JunctionIdListNames"> 
<xsd:sequence> 
<xsd:element name="names" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="RelationshipReferenceTo"> 
<xsd:sequence> 
<xsd:element name="referenceTo" minOccurs="0" maxOccurs="unbounded" type="xsd:string"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="RecordTypesSupported"> 
<xsd:sequence> 
<xsd:element name="recordTypeInfos" minOccurs="0" maxOccurs="unbounded" type="tns:RecordTypeInfo"/> 
</xsd:sequence> 
</xsd:complexType> 

<xsd:complexType name="RecordTypeInfo"> 
<xsd:sequence> 
<xsd:element name="available" type="xsd:boolean"/> 
<xsd:element name="defaultRecordTypeMapping" type="xsd:boolean"/> 
<xsd:element name="master" type="xsd:boolean"/> 
<xsd:element name="name" type="xsd:string"/> 
<xsd:element name="recordTypeId" type="tns:ID" nillable="true"/> 
</xsd:sequence> 
</xsd:complexType>

The link shared by Keith helped me in resolving this issue. Please find below link to know more about this issue- https://success.salesforce.com/issues_view?id=a1p3A000000eatxQAA&title=generated-wsdl-for-apex-webservices-is-malformed

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .