Java Web Service Implementation Examples
  • slane August 2010

    This is the Java EE 6 tutorial for Web Services which requires the use of Glassfish V3 for the examples:

    http://docs.sun.com/app/docs/doc/820-7627/bnayk?a=view

    These examples use the JAX-RS API from Glassfish to implement the web services,

    The approach is quite simple, In order to expose a method as a web method within a web service you annotate the method you want to expose with @WebMethod and its containing calss with @WebService. then you publish the class to a glassfish instance, here is a simple example from the tutorial:


    package helloservice.endpoint;

    import javax.jws.WebService;

    @WebService
    public class Hello {
    private String message = new String("Hello, ");

    public void Hello() {}

    @WebMethod
    public String sayHello(String name) {
    return message + name + ".";
    }
    }

  • steve August 2010

    Are you going to post some implementation techniques for other platforms ?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership