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
rawiswarrawiswar 

compilation error generating Apex code from external WSDL

Code:
The following generated class(es) have compilation errors:
Error: wwwOpenuriOrg

Error: unexpected token: tempOpenuriOrgWebserviceBpdataXsd.ArrayOfLISTINGID at 15:16

 
Code:
public class VerifyBPExistsReq_element {
        public tempOpenuriOrgWebserviceBpdataXsd.ArrayOfLISTINGID LIST;
        private String[] LIST_type_info = new String[]{'LIST','http://temp.openuri.org/WebService/BPData.xsd','ArrayOfLISTINGID','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://www.openuri.org/','true'};
        private String[] field_order_type_info = new String[]{'LIST'};
    }

This is the error message I am getting when I try to generate stubs from a production WSDL. Attached with the error message, is the code for the specified lines of the generated error-prone code. I am not sure why this is so. I am obviously missing something. Please do let me know what the error is. Thanks.
 
cheenathcheenath
I think List is a keyword and causing the error, you could change the code to:

public class VerifyBPExistsReq_element {
public tempOpenuriOrgWebserviceBpdataXsd.ArrayOfLISTINGID LIST1;
private String[] LIST1_type_info = new String[]{'LIST','http://temp.openuri.org/WebService/BPData.xsd','ArrayOfLISTINGID','1','1','false'};
private String[] apex_schema_type_info = new String[]{'http://www.openuri.org/','true'};
private String[] field_order_type_info = new String[]{'LIST1'};
}



rawiswarrawiswar
ok ..  got it working now! Thanks Manoj!