Monday, July 8, 2013

Creating Java Web Service
This post will teach you how to create JAVA web service using Netbeans IDE. 

1) first start new java web application.


2) then select the project and add new package . then right click on the project and go to New -> Web Service. then select the package that u want to add web service class.


3)then You can see web service class file 



4) then open the web service java class , then you can see the java web method.
 @WebMethod(operationName = "hello")

    public String hello(@WebParam(name = "name") String txt) {

        return "Hello " + txt + " !";

    }@WebMethod(operationName = "hello") - this annotation is use to show web method name in WSDL.@WebParam(name = "name") - this annotation use to show web method parameters in WSDL.



No comments:

Post a Comment