KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > soap > wsdl > SOAPHeader


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Emil Ong
27  */

28
29 package com.caucho.soap.wsdl;
30
31 import javax.xml.bind.annotation.XmlAccessType;
32 import javax.xml.bind.annotation.XmlAccessorType;
33 import javax.xml.bind.annotation.XmlAttribute;
34 import javax.xml.bind.annotation.XmlElement;
35 import javax.xml.bind.annotation.XmlRootElement;
36 import javax.xml.namespace.QName JavaDoc;
37 import java.util.ArrayList JavaDoc;
38 import java.util.List JavaDoc;
39
40 /**
41  * SOAP binding definition
42  */

43 @XmlAccessorType(XmlAccessType.FIELD)
44 @XmlRootElement(name="header",
45                 namespace="http://schemas.xmlsoap.org/wsdl/soap/")
46 public class SOAPHeader extends WSDLExtensibilityElement {
47   @XmlElement(name="headerfault",
48               namespace="http://schemas.xmlsoap.org/wsdl/soap/")
49   private List JavaDoc<SOAPHeaderFault> _faults;
50
51   @XmlAttribute(required=true, name="message")
52   private QName JavaDoc _message;
53
54   @XmlAttribute(required=true, name="part")
55   private String JavaDoc _part;
56
57   @XmlAttribute(required=true, name="use")
58   private SOAPUseChoice _use;
59
60   @XmlAttribute(name="encodingStyle")
61   private List JavaDoc<String JavaDoc> _encodingStyle;
62
63   @XmlAttribute(name="namespace")
64   private String JavaDoc _namespace;
65
66   public void addFault(SOAPHeaderFault fault)
67   {
68     if (_faults == null)
69       _faults = new ArrayList JavaDoc<SOAPHeaderFault>();
70
71     _faults.add(fault);
72   }
73
74   public List JavaDoc<SOAPHeaderFault> getFaults()
75   {
76     if (_faults == null)
77       _faults = new ArrayList JavaDoc<SOAPHeaderFault>();
78
79     return _faults;
80   }
81
82   /**
83    * Sets the message.
84    */

85   public void setMessage(QName JavaDoc message)
86   {
87     _message = message;
88   }
89   
90   /**
91    * Returns the message.
92    */

93   public QName JavaDoc getMessage()
94   {
95     return _message;
96   }
97
98   /**
99    * Sets the header part.
100    */

101   public void setPart(String JavaDoc part)
102   {
103     _part = part;
104   }
105   
106   /**
107    * Returns the header part.
108    */

109   public String JavaDoc getPart()
110   {
111     return _part;
112   }
113
114   public void addEncodingStyle(String JavaDoc encodingStyle)
115   {
116     if (_encodingStyle == null)
117       _encodingStyle = new ArrayList JavaDoc<String JavaDoc>();
118
119     _encodingStyle.add(encodingStyle);
120   }
121
122   public List JavaDoc<String JavaDoc> getEncodingStyle()
123   {
124     if (_encodingStyle == null)
125       _encodingStyle = new ArrayList JavaDoc<String JavaDoc>();
126
127     return _encodingStyle;
128   }
129
130   public void setNamespace(String JavaDoc namespace)
131   {
132     _namespace = namespace;
133   }
134
135   public String JavaDoc getNamespace()
136   {
137     return _namespace;
138   }
139
140   public void setUse(SOAPUseChoice use)
141   {
142     _use = use;
143   }
144
145   public SOAPUseChoice getUse()
146   {
147     return _use;
148   }
149 }
150
Popular Tags