Skip to content

Package: WebService

WebService

Coverage

1: /*
2: * Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Distribution License v. 1.0, which is available at
6: * http://www.eclipse.org/org/documents/edl-v10.php.
7: *
8: * SPDX-License-Identifier: BSD-3-Clause
9: */
10:
11: package jakarta.jws;
12:
13: import java.lang.annotation.Target;
14: import java.lang.annotation.Retention;
15: import java.lang.annotation.RetentionPolicy;
16: import java.lang.annotation.ElementType;
17:
18: /**
19: * Marks a Java class as implementing a Web Service, or a Java interface as defining a Web Service interface.
20: *
21: * @since 1.6
22: */
23: @Retention(value = RetentionPolicy.RUNTIME)
24: @Target(value = {ElementType.TYPE})
25: public @interface WebService {
26:
27: /**
28: * The name of the Web Service.
29: * <p>
30: * Used as the name of the wsdl:portType when mapped to WSDL 1.1.
31: *
32: * @return the name of the Web Service
33: * @specdefault The simple name of the Java class or interface.
34: */
35: String name() default "";
36:
37: /**
38: * If the @WebService.targetNamespace annotation is on a service endpoint interface, the targetNamespace is used
39: * for the namespace for the wsdl:portType (and associated XML elements).
40: * <p>
41: * If the @WebService.targetNamespace annotation is on a service implementation bean that does NOT reference a
42: * service endpoint interface (through the endpointInterface attribute), the targetNamespace is used for both the
43: * wsdl:portType and the wsdl:service (and associated XML elements).
44: * <p>
45: * If the @WebService.targetNamespace annotation is on a service implementation bean that does reference a service
46: * endpoint interface (through the endpointInterface attribute), the targetNamespace is used for only the
47: * wsdl:service (and associated XML elements).
48: *
49: * @return the {@code targetNamespace} annotation
50: * @specdefault Implementation-defined, as described in Jakarta XML Web Services Specification [5], section 3.2.
51: */
52: String targetNamespace() default "";
53:
54: /**
55: * The service name of the Web Service.
56: * <p>
57: * Used as the name of the wsdl:service when mapped to WSDL 1.1.
58: * <p>
59: * <i>This member-value is not allowed on endpoint interfaces.</i>
60: *
61: * @return the service name
62: * @specdefault The simple name of the Java class + Service".
63: */
64: String serviceName() default "";
65:
66: /**
67: * The port name of the Web Service.
68: * <p>
69: * Used as the name of the wsdl:port when mapped to WSDL 1.1.
70: * <p>
71: * <i>This member-value is not allowed on endpoint interfaces.</i>
72: *
73: * @return the port name
74: * @specdefault {@code @WebService.name}+Port.
75: *
76: * @since 2.0
77: */
78: String portName() default "";
79:
80: /**
81: * The location of a pre-defined WSDL describing the service.
82: * <p>
83: * The wsdlLocation is a URL (relative or absolute) that refers to a pre-existing WSDL file. The presence of a
84: * wsdlLocation value indicates that the service implementation bean is implementing a pre-defined WSDL contract.
85: * The JSR-181 tool MUST provide feedback if the service implementation bean is inconsistent with the portType and
86: * bindings declared in this WSDL. Note that a single WSDL file might contain multiple portTypes and multiple
87: * bindings. The annotations on the service implementation bean determine the specific portType and bindings that
88: * correspond to the Web Service.
89: *
90: * @return the location of a pre-defined WSDL
91: */
92: String wsdlLocation() default "";
93:
94: /**
95: * The complete name of the service endpoint interface defining the service's abstract Web Service contract.
96: * <p>
97: * This annotation allows the developer to separate the interface contract from the implementation. If this
98: * annotation is present, the service endpoint interface is used to determine the abstract WSDL contract (portType
99: * and bindings). The service endpoint interface MAY include JSR-181 annotations to customize the mapping from
100: * Java to WSDL.
101: * <br>
102: * The service implementation bean MAY implement the service endpoint interface, but is not REQUIRED to do so.
103: * <br>
104: * If this member-value is not present, the Web Service contract is generated from annotations on the service
105: * implementation bean. If a service endpoint interface is required by the target environment, it will be
106: * generated into an implementation-defined package with an implementation- defined name
107: * <p>
108: * <i>This member-value is not allowed on endpoint interfaces.</i>
109: *
110: * @return the complete name of the service endpoint interface
111: */
112: String endpointInterface() default "";
113: };