+ 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!