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
Bms270Bms270 

Error: unexpected token: void

I am trying to generate Apex class from my WSDL file. WSDL gets parsed with no error but I get the following error in the last step of the process:

The following generated class(es) have compilation errors:

Error: webservicesCommerce

Error: unexpected token: void at 240:16


and the generated class at 240:16 is the start of the following function:

public void update(webservicesCommerce.Customer in0) {   //line 240
    webservicesCommerce.update_element request_x = new webservicesCommerce.update_element();
    webservicesCommerce.updateResponse_element response_x;
    request_x.in0 = in0;
    Map<String, webservicesCommerce.updateResponse_element> response_map_x = new Map<String, webservicesCommerce.updateResponse_element>();
    response_map_x.put('response_x', response_x);
    WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://webservices.commerce.xxx.com',
              'update',
              'http://webservices.commerce.xxx.com',
              'updateResponse',
              'webservicesCommerce.updateResponse_element'}
            );
            response_x = response_map_x.get('response_x');
        }


so what could be wrong here? does this mean that we cannot have void functions in Apex? I have more functions that they dont return anything. any Idea?



Message Edited by Bms270 on 09-29-2008 04:06 PM
Bms270Bms270
I Figured it out myself! the word "update" for function name is a reserved word, and esdl generator does not rename it. so becareful of these reserved words.