Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6635529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:03:58+00:00 2026-05-25T23:03:58+00:00

When I am trying to generate Apex classes from the below WSDL file I

  • 0

When I am trying to generate Apex classes from the below WSDL file I am getting the
The following generated class(es) have compilation errors:
Error: testxyzCom
Error: unexpected token: ‘limit’ at 7:23

The generated class is also given below. I already have some experience in Salesforce and as far as I remember if a WSDL document contains an Apex reserved word, the word is appended with _x when the Apex class is generated. For example, limit in a WSDL document converts to limit_x in the generated Apex class. But this is not happening in above case please explain. Please help me out.

The WSDL file

<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions targetNamespace="http://test.xyz.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://test.xyz.com" xmlns:intf="http://test.xyz.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
<!--WSDL created by Apache Axis version: 1.4 
Built on Apr 22, 2006 (06:55:48 PDT)--> 
<wsdl:types> 
<schema elementFormDefault="qualified" targetNamespace="http://test.xyz.com" xmlns="http://www.w3.org/2001/XMLSchema"> 
<element name="createOpurtunityData"> 
<complexType> 
<sequence> 
<element maxOccurs="unbounded" name="keys" type="xsd:string"/> 
<element maxOccurs="unbounded" name="values" type="xsd:string"/> 
<element name="limit" type="xsd:int"/> 
</sequence> 
</complexType> 
</element> 
<element name="createOpurtunityDataResponse"> 
<complexType> 
<sequence> 
<element maxOccurs="unbounded" name="createOpurtunityDataReturn" type="xsd:string"/> 
</sequence> 
</complexType> 
</element> 
</schema> 
</wsdl:types> 

<wsdl:message name="createOpurtunityDataResponse"> 

<wsdl:part element="impl:createOpurtunityDataResponse" name="parameters"> 

</wsdl:part> 

</wsdl:message> 

<wsdl:message name="createOpurtunityDataRequest"> 

<wsdl:part element="impl:createOpurtunityData" name="parameters"> 

</wsdl:part> 

</wsdl:message> 

<wsdl:portType name="TestWSDL"> 

<wsdl:operation name="createOpurtunityData"> 

<wsdl:input message="impl:createOpurtunityDataRequest" name="createOpurtunityDataRequest"> 

</wsdl:input> 

<wsdl:output message="impl:createOpurtunityDataResponse" name="createOpurtunityDataResponse"> 

</wsdl:output> 

</wsdl:operation> 

</wsdl:portType> 

<wsdl:binding name="TestWSDLSoapBinding" type="impl:TestWSDL"> 

<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 

<wsdl:operation name="createOpurtunityData"> 

<wsdlsoap:operation soapAction=""/> 

<wsdl:input name="createOpurtunityDataRequest"> 

<wsdlsoap:body use="literal"/> 

</wsdl:input> 

<wsdl:output name="createOpurtunityDataResponse"> 

<wsdlsoap:body use="literal"/> 

</wsdl:output> 

</wsdl:operation> 

</wsdl:binding> 

<wsdl:service name="TestWSDLService"> 

<wsdl:port binding="impl:TestWSDLSoapBinding" name="TestWSDL"> 

<wsdlsoap:address location="http://tempuri.org/Salesforcexyz/services/TestWSDL"/> 

</wsdl:port> 

</wsdl:service> 

</wsdl:definitions> 

Generated Apex class is

/Generated by wsdl2apex 

public class testxyzCom { 
public class createOpurtunityData_element { 
public String[] keys; 
public String[] values; 
public Integer limit; 
private String[] keys_type_info = new String[]{'keys','http://www.w3.org/2001/XMLSchema','string','1','-1','false'}; 
private String[] values_type_info = new String[]{'values','http://www.w3.org/2001/XMLSchema','string','1','-1','false'}; 
private String[] limit_type_info = new String[]{'limit','http://www.w3.org/2001/XMLSchema','int','1','1','false'}; 
private String[] apex_schema_type_info = new String[]{'http://test.xyz.com','true','false'}; 
private String[] field_order_type_info = new String[]{'keys','values','limit'}; 
} 
public class TestWSDL { 
public String endpoint_x = 'http://tempuri.org/Salesforcexyz/services/TestWSDL'; 
public Map<String,String> inputHttpHeaders_x; 
public Map<String,String> outputHttpHeaders_x; 
public String clientCertName_x; 
public String clientCert_x; 
public String clientCertPasswd_x; 
public Integer timeout_x; 
private String[] ns_map_type_info = new String[]{'http://test.xyz.com', 'testxyzCom'}; 
public String[] createOpurtunityData(String[] keys,String[] values,Integer limit) { 
testxyzCom.createOpurtunityData_element request_x = new testxyzCom.createOpurtunityData_element(); 
testxyzCom.createOpurtunityDataResponse_element response_x; 
request_x.keys = keys; 
request_x.values = values; 
request_x.limit = limit; 
Map<String, testxyzCom.createOpurtunityDataResponse_element> response_map_x = new Map<String, testxyzCom.createOpurtunityDataResponse_element>(); 
response_map_x.put('response_x', response_x); 
WebServiceCallout.invoke( 
this, 
request_x, 
response_map_x, 
new String[]{endpoint_x, 
'', 
'http://test.xyz.com', 
'createOpurtunityData', 
'http://test.xyz.com', 
'createOpurtunityDataResponse', 
'testxyzCom.createOpurtunityDataResponse_element'} 
); 
response_x = response_map_x.get('response_x'); 
return response_x.createOpurtunityDataReturn; 
} 
} 
public class createOpurtunityDataResponse_element { 
public String[] createOpurtunityDataReturn; 
private String[] createOpurtunityDataReturn_type_info = new String[]{'createOpurtunityDataReturn','http://www.w3.org/2001/XMLSchema','string','1','-1','false'}; 
private String[] apex_schema_type_info = new String[]{'http://test.xyz.com','true','false'}; 
private String[] field_order_type_info = new String[]{'createOpurtunityDataReturn'}; 
} 
} 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:03:59+00:00Added an answer on May 25, 2026 at 11:03 pm

    I’ve had a similar issue recently with a WSDL that generated an APEX class using the reserved keyword ‘long’.

    I don’t think wsdl2apex is smart enough to add a suffix to reserved keywords as you suggest.

    Can you do it by hand to the generated class?

    In createOpurtunityData_element

    public Integer limit_x; 
    

    In TestWSDL

    public String[] createOpurtunityData(String[] keys,String[] values,Integer limit_x) {
    
    request_x.limit_x = limit_x;
    

    I’m not 100% sure how the call to WebServiceCallout.invoke will handle this change though. If you can, it would be easier to update the web service and WSDL so it doesn’t use a APEX keyword.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
I'm trying to generate customized xml files from a template xml file in python.
I'm trying to generate a pdf file from data in a database using JasperReports
i am trying to generate the following list in asp.net? <div class=items> <!-- 1-5
I am trying to generate a schema from this xml file: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?rettype=xml&retmode=xml&db=nucleotide&id=AB573763 I store
I'm trying to generate NHibernate mappings with ActiveRecord. I can create classes from a
I am trying to generate java file from wsdlurl. some of them are working
I'm trying to generate SQL table header from a csv file. As I had
I am trying to generate a Sandcastle help file for a website. In the
I am just trying to generate the classes for linq to mysql with dbmetal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.