Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Scout/Tutorial/3.8/webservices/CompanyWebService implementation

The Scout documentation has been moved to https://eclipsescout.github.io/.

@ScoutWebService
@WebService(endpointInterface = "org.eclipse.scout.tutorial.jaxws.services.ws.companywebservice.CompanyWebServicePortType")
public class CompanyWebService implements CompanyWebServicePortType {
 
  @Override
  public List<Company> getCompanies() {
    // holder to create a company bean for each company record in database
    BeanArrayHolder<Company> companyBeanHolder = new BeanArrayHolder<Company>(Company.class);
    try {
      // run SQL
      SQL.selectInto("" +
          "SELECT   NAME, " +
          "         SYMBOL " +
          "FROM     COMPANY " +
          "INTO     :{name}, " +
          "         :{symbol}"
          , companyBeanHolder
          );
    }
    catch (ProcessingException e) {
      ScoutLogManager.getLogger(CompanyWebService.class).error("failed to load company data", e);
    }
    return Arrays.asList(companyBeanHolder.getBeans());
  }
}

Back to the top