In this section we revisit the Arithmetic
endpoint implementation class and override some of the defaults. Below is the new listing of Arithmetic
with the modifications highlighted:
package endpoint; import javax.jws.WebService; import javax.jws.WebMethod; @WebService( name="Maths", service Name="MathsWebService", targetNamespace="http://wsimport") public class Arithmetic { public Arithmetic() {} @WebMethod( operationName="product") public int multiply(int a, int b) { int c = a * b ; return c; } }
First we look at some of the properties of the @WebService
annotation. The name
property sets the name associated with the WSDL port type. This defaults to the Java class or interface name, Arithmetic
in our case.
The serviceName
property sets the WSDL service name as indicated by the <service>
element. The default is the Java class name with "Service" appended, ArithmeticService
in our case.
The targetNamespace
property sets the XML namespace for WSDL...