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
YallDevYallDev 

WSDL creation Error: unexpected token: 'Select'

I am very new to apex and I am trying to learn it on my own, I have been trying to create a webservice from my wsdl file, but i get the error below.

 

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


Error: unexpected token: 'Select' at 748:46.

 

After reading I have found out that select is a keyword. The select keyword is in my method:

here is a snippet of my wsdl. And most of my class names also include this is there any advice or tips for solving this because changing the webservice

would be a major issue. 

 

 public xserver.SelectResult Select (String tXqlQuery) {
            xserver.Select_element request_x = new xserver.Select_element();
            xserver.SelectResponse_element response_x;
            request_x.tXqlQuery = tXqlQuery;
            Map<String, xserver.SelectResponse_element> response_map_x = new Map<String, xserver.SelectResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://XServer/Select',
              'http://XServer/',
              'Select',
              'http://XServer.nl/',
              'SelectResponse',
              'xserver.nl.SelectResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.SelectResult;
        }

 

 

Thanks

 

Jamil

kerwintangkerwintang

I would think that only "Select" is the keyword, and only the "Select" method will fail. All your other methods containing the word "select" should be fine.

 

Will it be possible to change the name of the Select method?

YallDevYallDev

Thanks for  your reply,  The WSDL is already defined and I may not be able to change it. Do you think there is a possible work around example creating a wrapper class or something like this.

 

Thx again