Java Code

Lets walk through the java code now, here we basically define the interfaces for our web services and add the implementation for the same as well

  • The HelloWorld.java interface has a one method that takes in a string parameter. Notice the annotations (@WebService to define a web service and @WebParam to define a parameter)
    package com.yosanai.tutorial.ws.hellowebservice;
    
    import javax.jws.WebParam;
    import javax.jws.WebService;
    
    /**
     * @author Saravana P Shanmugam
     * 
     */
    @WebService
    public interface HelloWorld {
        String sayHi(@WebParam(name = "message") String text);
    }
    
  • The FileManagement.java interface has a one method that takes in a File.java object as parameter. Notice the annotations (@WebService to define a web service and @WebParam to define a parameter)
    package com.yosanai.tutorial.ws.hellowebservice;
    
    import javax.jws.WebParam;
    import javax.jws.WebService;
    
    /**
     * @author Saravana P Shanmugam
     * 
     */
    @WebService
    public interface FileManagement {
    
        public String upload(@WebParam(name = "file") File file) throws Exception;
    }
    

Who's online

There are currently 0 users and 2 guests online.

Who's new

  • Saravana Peruma...