javax.jws.WebMethod : WebMethod « javax.jws « Java by API






javax.jws.WebMethod

  

import java.text.SimpleDateFormat;
import java.util.Calendar;

import javax.jws.WebMethod;
import javax.jws.WebService;

@WebService()
public class Main {

  @WebMethod
  public String getTime() {

    Calendar calendar = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
    return (sdf.format(calendar.getTime()));

  }

}

   
    
  








Related examples in the same category

1.WebMethod.action()
2.WebMethod.operationName()