Developing a Web Service from a WSDL Description (Top down approach)

  1. Download Addition.wsdl
  2. Define the following directory/file structure:
      - Addition
        - META-INF
          - Addition.wsdl
  1. Generate the Java files on the server side using the following command:
    wsdl2java.bat -uri META-INF/Addition.wsdl -p addition -d adb -s -ss -sd -ssi
    
    or 
    
    wsdl2java.bat -uri META-INF/Addition.wsdl -p addition -d adb -s -ss -sd -ssi .
    
       
  2. Add service processing logic to the server implementation class (AdditionServiceSkeleton.java):
    int a = additionner0.getEntier1();
    int b = additionner0.getEntier2();
    calculette.AdditionnerResponse resp = new calculette.AdditionnerResponse();	
    resp.setResultat1(a+b);
    return resp;
  3. start an axis server with the service by running ant start.server.
  4. Deploy the service on Axis by copying build/lib/AdditionService.aar to /repository/services directory of axis.
  5. Write a client to query this service (by running wsdl2java.sh -uri http://localhost:8080/axis2/services/AdditionService?wsdl -d adb)