Create a simple Web Service : JAX WS « Web Services SOA « Java






Create a simple Web Service

 

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.Simple web service based on jaxws
2.JAX-WS: Style Example
3.JAX-WS: simple client cert
4.JAX-WS: simpleclient basic authentication
5.JAX-WS: simpleclient
6.JAX-WS: Raw Bytes Mtom
7.JAX-WS: Polymorphic Processor With Validation
8.JAX-WS: Polymorphic Processor
9.JAX-WS: Nodatabinding-JAXB-Integration
10.JAX-WS: No data binding
11.JAX-WS Any URI
12.XML Web Service WSDL
13.Developing Web Services Using JAX-WSDeveloping Web Services Using JAX-WS