Suppose, you have a piece of code that implements certain functionality and you want this functionality to be available on the Web through a specific protocol. In this case you need to transform the existing code into a Web service and deploy. Such transformation is called exposing a class as Web service and should be applied to each class. The action updates the Web service descriptors and generates additional deployment code if needed. This action is required every time any Web service method signature is changed or a new method is added or removed.
- Position the cursor at the class name in the editor and press Alt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+EnterAlt+Enter, Shift+Alt+J or Ctrl+Shift+MAlt EnterAlt EnterCommand 1 or click the yellow bulb icon .
- From the suggestion list, choose Expose Class as Web Service.
- In the Expose Class As Web Service dialog box that opens, specify the following:
- The name and URL address of the Web service.
- The protocol and encoding style used when accessing the public operations of the Web service.
- The type information, including name, operations, parameters and data comprising the interface of the Web service.
IntelliJ IDEA automatically adds the service description to the server-config.wsdd file.