1 package org.codehaus.xfire.annotations;
2
3 import org.codehaus.xfire.service.OperationInfo;
4
5 /***
6 * Represents an common representation of a web method annotation. Specifies that the given method is exposed as a Web
7 * Service operation, making it part of the Web ServiceĆs public contract. A WebMethod annotation is required for each
8 * method that is published by the Web Service.
9 *
10 * @author Arjen Poutsma
11 */
12 public class WebMethodAnnotation
13 {
14 private String action = "";
15 private String operationName = "";
16
17 /***
18 * Returns the action for this operation. For SOAP bindings, this determines the value of the SOAPAction header.
19 *
20 * @return the action for this operation.
21 */
22 public String getAction()
23 {
24 return action;
25 }
26
27 /***
28 * Sets the action for this operation. For SOAP bindings, this determines the value of the SOAPAction header.
29 *
30 * @param action the new action for this operation.
31 */
32 public void setAction(String action)
33 {
34 this.action = action;
35 }
36
37 /***
38 * Returns the name of the wsdl:operation matching this method. By default the WSDL operation name will be the same
39 * as the Java method name.
40 *
41 * @return the name of the wsdl:operation matching this method.
42 */
43 public String getOperationName()
44 {
45 return operationName;
46 }
47
48 /***
49 * Sets the name of the wsdl:operation matching this method. By default the WSDL operation name will be the same as
50 * the Java method name.
51 *
52 * @param operationName the new name of the wsdl:operation matching this method.
53 */
54 public void setOperationName(String operationName)
55 {
56 this.operationName = operationName;
57 }
58
59 /***
60 * Populates the given operation info with the information contained in this annotation.
61 *
62 * @param operationInfo the operation info.
63 */
64 public void populate(OperationInfo operationInfo)
65 {
66 if (operationName.length() != 0)
67 {
68 operationInfo.setName(operationName);
69 }
70 }
71
72 /***
73 * Returns a <code>String</code> representation of this <code>WebMethodAnnotation</code>.
74 *
75 * @return a string representation.
76 */
77 public String toString()
78 {
79 return "WebMethodAnnotation{" +
80 "action='" + action + "'" +
81 ", operationName='" + operationName + "'" +
82 "}";
83 }
84 }