View Javadoc

1   package org.codehaus.xfire.annotations;
2   
3   
4   /***
5    * Represents an common representation of a web result annotation. Customizes the mapping of the return value to a WSDL
6    * part and XML element.
7    *
8    * @author Arjen Poutsma
9    */
10  public class WebResultAnnotation
11  {
12      private String name = "return";
13      private String targetNamespace = "";
14  
15      /***
16       * Returns the name of the return value as it appears in the WSDL and messages on the wire. For RPC bindings, this
17       * is the name of the wsdl:part representing the return value. For document bindings, this is the local name of the
18       * XML element representing the return value.
19       *
20       * @return the name of the return value.
21       */
22      public String getName()
23      {
24          return name;
25      }
26  
27      /***
28       * Sets the name of return value as it appears in the WSDL and messages on the wire. For RPC bindings, this is the
29       * name of  the wsdl:part representing the return value. For document bindings, this is the local name of the XML
30       * element  representing the return value.
31       *
32       * @param name the new name of the return value.
33       */
34      public void setName(String name)
35      {
36          this.name = name;
37      }
38  
39      /***
40       * Returns the XML namespace for the return value. Only used with document bindings, where the return value maps to
41       * an  XML element. Defaults to the targetNamespace of the Web Service.
42       *
43       * @return the XML namespace for the return value.
44       */
45      public String getTargetNamespace()
46      {
47          return targetNamespace;
48      }
49  
50      /***
51       * Sets the XML namespace for the return value. Only used with document bindings, where the return value maps to an
52       * XML element. Defaults to the targetNamespace of the Web Service.
53       *
54       * @param targetNamespace the new XML namespace for the return value.
55       */
56      public void setTargetNamespace(String targetNamespace)
57      {
58          this.targetNamespace = targetNamespace;
59      }
60  
61      /***
62       * Returns a String representation of this <code>WebResultAnnotation</code> attribute.
63       *
64       * @return a string representation.
65       */
66      public String toString()
67      {
68          return "WebResultAnnotation{" +
69                  "name='" + name + "'" +
70                  ", targetNamespace='" + targetNamespace + "'" +
71                  "}";
72      }
73  }