O'Reilly logo

Apache Axis2 Web Services Second Edition by Afkham Azeez, Deepal Jayasinghe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Code first service development with JAX-WS

We already have looked at several code segments, involving the code first JAX-WS development. But for the sake of completeness, let us look at a complete sample. In this example, the StudentMarksService class contains two operations called computeAverage and computeHighestMarks. Both these methods take in a Student object as a parameter. You can see how we can customize the WSDL service interface using the annotations. The sample code for this sample is shown here. The @WebService annotation specifies that the name of this service should be StudentMarksService with the namespace http://apache.org/jaxws/sample. The WSDL style is declared as document-literal, and the parameters are wrapped.

StudentMarksService.java ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required