Creating a Web service from an annotated EJB bean by publishing to a server
After annotating an EJB bean, you can generate a Web service application by publishing the application project of the bean directly to a server. When your Web service is generated, no WSDL file is created in your project.
Prerequisites:
- For an EJB bean in your workspace, you have already specified Web services annotations, including at least the @WebService and @Stateless annotations. If there are validation errors or warnings in the Java™ editor, you should address these to prevent potential problems at run time.
- You have created the router modules for the Web service.
- You have already created a server in your workspace.
To create a Web service from an annotated EJB bean:
- Open the Servers view, if it is not already open, by clicking
Window | Show View | Servers in the menu bar.
- If the application project that contains your EJB bean has not been published to a server:
- In the Servers view, right-click the server where you want to publish your application.
- In the menu, click
Add and Remove Projects.
- In the Add and Remove Projects window, from the
Available projects list, select the application project that contains your EJB bean.
- Click
Add; then click Finish.
- If you haven't specified a preference for automatically publishing to local servers, right-click the server where you want to publish your application and click
Publish.
Your EJB bean is published as a Web service on the server. JAXB classes are generated and packaged into the application at the point of publication.