Time for action – exposing a method using the client interface
Carry out the following steps to expose a method using the client interface:
Open the
EmpDirectoryModuleImpl.java
file and add the following method:public String getHelloWorld(){ return "Hello World"; }
Go to the Java tab from the
EmpDirectoryModule.xml
file, and click on the pencil icon in the Client Interface section.The Edit Client Interface window will open. Move the
getHelloWorld()
method from the Available list to the Selected list as shown in the following screenshot:Click on the OK button to create the interface method.
What just happened?
We now
have the client interface defined to expose the getHelloWorld()
method from the EmpDirectoryModuleImpl
class to the outside world. The EmpDirectoryModule.java
interface will be created to expose the method as a service in the data control. The EmpDirectoryModuleClient
class will implement the interface to invoke the getHelloWorld()
method from EmpDirectoryModuleImpl
.
You can...