001: /*
002: * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Emil Ong
027: */
028:
029: package com.caucho.soap.wsdl;
030:
031: import javax.xml.bind.annotation.XmlAccessType;
032: import javax.xml.bind.annotation.XmlAccessorType;
033: import javax.xml.bind.annotation.XmlAttribute;
034: import javax.xml.bind.annotation.XmlElement;
035: import javax.xml.bind.annotation.XmlRootElement;
036: import javax.xml.namespace.QName;
037: import java.util.ArrayList;
038: import java.util.List;
039:
040: /**
041: * SOAP binding definition
042: */
043: @XmlAccessorType(XmlAccessType.FIELD)
044: @XmlRootElement(name="header",namespace="http://schemas.xmlsoap.org/wsdl/soap/")
045: public class SOAPHeader extends WSDLExtensibilityElement {
046: @XmlElement(name="headerfault",namespace="http://schemas.xmlsoap.org/wsdl/soap/")
047: private List<SOAPHeaderFault> _faults;
048:
049: @XmlAttribute(required=true,name="message")
050: private QName _message;
051:
052: @XmlAttribute(required=true,name="part")
053: private String _part;
054:
055: @XmlAttribute(required=true,name="use")
056: private SOAPUseChoice _use;
057:
058: @XmlAttribute(name="encodingStyle")
059: private List<String> _encodingStyle;
060:
061: @XmlAttribute(name="namespace")
062: private String _namespace;
063:
064: public void addFault(SOAPHeaderFault fault) {
065: if (_faults == null)
066: _faults = new ArrayList<SOAPHeaderFault>();
067:
068: _faults.add(fault);
069: }
070:
071: public List<SOAPHeaderFault> getFaults() {
072: if (_faults == null)
073: _faults = new ArrayList<SOAPHeaderFault>();
074:
075: return _faults;
076: }
077:
078: /**
079: * Sets the message.
080: */
081: public void setMessage(QName message) {
082: _message = message;
083: }
084:
085: /**
086: * Returns the message.
087: */
088: public QName getMessage() {
089: return _message;
090: }
091:
092: /**
093: * Sets the header part.
094: */
095: public void setPart(String part) {
096: _part = part;
097: }
098:
099: /**
100: * Returns the header part.
101: */
102: public String getPart() {
103: return _part;
104: }
105:
106: public void addEncodingStyle(String encodingStyle) {
107: if (_encodingStyle == null)
108: _encodingStyle = new ArrayList<String>();
109:
110: _encodingStyle.add(encodingStyle);
111: }
112:
113: public List<String> getEncodingStyle() {
114: if (_encodingStyle == null)
115: _encodingStyle = new ArrayList<String>();
116:
117: return _encodingStyle;
118: }
119:
120: public void setNamespace(String namespace) {
121: _namespace = namespace;
122: }
123:
124: public String getNamespace() {
125: return _namespace;
126: }
127:
128: public void setUse(SOAPUseChoice use) {
129: _use = use;
130: }
131:
132: public SOAPUseChoice getUse() {
133: return _use;
134: }
135: }
|