Creating a Service Implementation Bean

The Java class that implements the Service Endpoint Interface is called the Service Implementation Bean. Learning odd new bits of jargon is an unavoidable part of JAX-WS.

The SquareRootServerImpl class implements the SquareRootServer interface, as stated in the class declaration:

public class SquareRootServerImpl implements SquareRootServer {

This means the class you’re creating must contain all the methods in the interface, each with the proper parameters.

The getSquareRoot(double) and getTime() methods are implemented using techniques you’ve learned previously.

The only new aspect of the class is the following annotation, which appears before the class statement:

@WebService(endpointInterface = "com.java24hours.ws.SquareRootServer" ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.