# The @WebService annotation

The @WebService annotation is defined by the javax.jws.WebService interface and it is placed on an interface or a class that is intended to be used as a service. @WebService has the following properties:

| Property | Description |
| --- | --- |
| name | Specifies the name of the service interface. This property is mapped to<br>the name attribute of the wsdl:portType element that defines<br>the service's interface in a WSDL contract. The default is to append<br>PortType to the name of the implementation class. |
| targetNamespace | Specifies the target namespace under which the service is defined. If<br>this property is not specified, the target namespace is derived from the<br>package name. |
| serviceName | Specifies the name of the published service. This property is mapped to<br>the name attribute of the wsdl:service element<br>that defines the published service. The default is to use the name of the<br>service's implementation class. Note: Not<br>allowed on the SEI |
| wsdlLocation | Specifies the URI at which the service's WSDL contract is stored. The<br>default is the URI at which the service is deployed. |
| endpointInterface | Specifies the full name of the SEI that the implementation class<br>implements. This property is only used when the attribute is used on a<br>service implementation class. Note: Not<br>allowed on the SEI |
| portName | Specifies the name of the endpoint at which the service is published.<br>This property is mapped to the name attribute of the<br>wsdl:port element that specifies the endpoint details for a<br>published service. The default is the append Port to the name<br>of the service's implementation class. Note: Not allowed on the SEI |

Information noteNote: You do not need to provide values for any of the @WebService annotation's properties. However, it is recommended that you provide as much information as you can.