Through the service interface, a web service exposes functionality to the outer world. The interface methods can be simple, such as setting properties to more complex operations such as performing calculations or updating records in a database. We have described the WSDL interface in the introduction of Chapter 2, Calling Services from BPEL, however, in this recipe, we will work on the Java interface. We use the Java interface when the Java code itself will define the web service and the WSDL document of deployed web services is generated from the Java code.
We described in the Introduction section that the core of the sample is the BookLibrary
class. However, the sample is not yet implemented. To set up a proper service interface, we define an exception in the project (BookAlreadyBorrowed
). This exception will be thrown when any member of the library tries to borrow an already borrowed book. The exception extends the Java standard Exception
class...