Development of a Web service (Client + Server): calculation of the different integer operation integers

Web service development

  1. Proceeding as previously (Hello World exercise), you are asked to define a web service that calculates the square and the double of a number and the sum multiplication, and the division of two intgers.
  2. The service returns this time a number. The method to be invoked has a parameter.
  3. To process methods with parameters, suppose your service has the computeSquare method with the following signature:
        public class SquareDouble{
                public int computeSquare (int nb) {
                          return nb * nb;
                }
     
                // fininsh the other operations
      }
     
  4. Assuming that your service is called SquareWorldService, the invocation will then be carried out as follows:
       http://localhost:8080/axis2/services/SquareWorldService/computeSquare?args0=10
  5. You will get the following response (still in SOAP XML format), here is an excerpt:
     <soapenv: Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance ">
       <soapenv: Body>
         <calculateResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
           <calculateReturn xsi:type="xsd:int"> 100 </calculeReturn>
         </calculeResponse>
       </soapenv:Body>
     </soapenv:Envelope>

Client development

  1. Develop a java client as before (Hello World exercise) or Servlet which gives the square, the double, the addition, multiplication, sous traction and division of integers.
teaching_assistant/web_services/web_service_client_double_square.txt · Last modified: 2023/09/25 12:05 by IT Courses (NNC)
Back to top
CC Attribution-Share Alike 4.0 International
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0