Create a simple Web Service
import java.text.SimpleDateFormat;
import java.util.Calendar;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService()
public class JavadbWebService {
@WebMethod
public String getTime() {
Calendar calendar = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
return (sdf.format(calendar.getTime()));
}
}
The result of a call to the operation getTime produces something like this:
14:15
This is the SOAP request and response to the web service:
0 comments: