Define a Java interface for the Election service suitable for use as a web service. State why you think the interface you defined is suitable. Explain how a WSDL document for the service is generated and how it is made available to clients.

What will be an ideal response?

The interface to the service is defined as a Java class. We need to define a class for the result e.g.
```
class Result {
String name;
int votes;
}

The interface is:

import java.rmi.*;
public interface Election extends Remote{
void vote(String name, int number) throws RemoteException; Result result () throws RemoteException;
};
```
This is suitable because it does not pass values of Remote as arguments or results.

The tool wscompile is used to generate a WSDL document describing the service from the above interface. When the service is deployed, this document is installed in the servlet container from whence clients may get it.

Computer Science & Information Technology

You might also like to view...

A directs a user to take a specific action.

a) declaration b) error c) prompt d) None of the above.

Computer Science & Information Technology

Identify the processes running on a computer, the protocol they are using, and their local and remote port addresses.

For a hacker to establish a connection to a remote computer, a port must be listening on that device. This may be due to infection by malware, or a vulnerability in a legitimate piece of software. A utility, such as TCPView, can be used to detect open ports, monitor them in real-time, and close active ports and processes using them.

Computer Science & Information Technology