JaiswalTraining

Get the online training



Corejava Servlet Jsp  Php  Hibernate  Ajax Web Service   Ejb2.1 Ejb3.0 Struts Struts2  JPA Spring Ibatis   JSF    JSF2.0  CoreJavaDesignPattern    Jquery  Flex J2EE-Design-Patterns  Jboss7  Maven  Contact Me                                                                                                                                                                        
            IGNOU SMU PTU Project                                           Training                                                                                                                              
              

Contact Us  0091- 9210721663         jaiswaltraining@gmail.com





Corejava
Servlet
Jsp
Php
Hibernate
Ajax
Web Service
Ejb2.1
Ejb3.0
Struts  
Struts2
JPA
Spring
Ibatis
JSF
JSF2.0
CoreJavaDesignPattern
Jquery
Flex
J2EE-Design-Patterns
Jboss7
Maven







Web Service In Eclipse using AXIS Tool


  • Axis tool is very poular for web service program
  • It can be used along with tomcat web server as well as with any
    application server such as
  •  Jboss
  • Weblogic
  • Websphere
  • Create a Dynamic Web Project
  • Give the name of the project as AdditionWebService
  • Select the target runtime server as tomcat




  • Take a new java class file.
  • WebService program can be created with any class file
    or  servlet jsp or Ejb file
  • In this example we are  taking  a java file.






  • Type the name of the class as sum.
  • Give the required package name or let it be default
    i.e without any package
  • Click on the next button.




  • It creates a java file.
  • Now add the code to it as given below.

public class sum {

  public String add(int a,int b){
    return "sum of "+a+" and "+b+" is "+(a+b);
  }
}


  • Now we will create a web service program using the sum.java file.
  • Right click on the  project.
  • Select New->web services->web service as shown below in fig.



  • Select Server as Tomcat
  • Select  Web service runtime as Apache Axis
  • Select Service project as Additionweb service
  • Click on the browse Button.





  • Type the sum in the text box
  • Select sum(default package)

  • In the Test client frame select following for the configuration
    • Select Server as Tomcat
    • Select  Web service runtime as Apache Axis
    • Select Client project as Additionweb serviceClient
  • Click Next.




  • In coming window shows the wsdl file as sum.wsdl
  • This file gets created by the wizard on clicking next.
  • Click on Next button.


  • In window Test Web Service  facility select Web Service Explorer.
  • Web service can be tested by the client as well as by the Web Service Explorer.




  • It creates the WebService program along with  AdditionWebServiceClient.
  • It will open a browser for Web Service Explorer.
  • The web service program can be tested there.

  • The fig below shows the files created for the Addition web service.
  • It has deploy.wsdl, undeply.wsdd file  in the sumService->DefaultNameSpace folder.
  • wsdl folder contains sum.wsdl file.
  • The AdditionWebservice file structure is as follows.