001: /*
002: * Copyright (c) 1998-2007 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 java.io.IOException;
032:
033: import java.util.ArrayList;
034: import java.util.List;
035:
036: import javax.xml.bind.annotation.XmlAccessType;
037: import javax.xml.bind.annotation.XmlAccessorType;
038: import javax.xml.bind.annotation.XmlElement;
039: import javax.xml.bind.annotation.XmlTransient;
040: import javax.xml.bind.annotation.XmlType;
041:
042: import static com.caucho.soap.wsdl.WSDLConstants.*;
043:
044: import com.caucho.java.JavaWriter;
045:
046: /**
047: * WSDL operation definition
048: */
049: @XmlType(name="tBindingOperation",namespace=WSDL_NAMESPACE)
050: public class WSDLBindingOperation extends WSDLNamedExtensibleDocumented {
051: @XmlElement(name="input",namespace=WSDL_NAMESPACE)
052: private WSDLBindingOperationMessage _input;
053:
054: @XmlElement(name="output",namespace=WSDL_NAMESPACE)
055: private WSDLBindingOperationMessage _output;
056:
057: @XmlElement(name="fault",namespace=WSDL_NAMESPACE)
058: private List<WSDLBindingOperationFault> _faults;
059:
060: @XmlTransient
061: private WSDLOperation _operation;
062:
063: public void setInput(WSDLBindingOperationMessage input) {
064: _input = input;
065: }
066:
067: /**
068: * Returns the input.
069: */
070: public WSDLBindingOperationMessage getInput() {
071: return _input;
072: }
073:
074: public void setOutput(WSDLBindingOperationMessage output) {
075: _output = output;
076: }
077:
078: /**
079: * Returns the output.
080: */
081: public WSDLBindingOperationMessage getOutput() {
082: return _output;
083: }
084:
085: public void addFault(WSDLBindingOperationFault fault) {
086: if (_faults == null)
087: _faults = new ArrayList<WSDLBindingOperationFault>();
088:
089: _faults.add(fault);
090: }
091:
092: public List<WSDLBindingOperationFault> getFaults() {
093: return _faults;
094: }
095:
096: public void setOperation(WSDLOperation operation) {
097: _operation = operation;
098: }
099:
100: public WSDLOperation getOperation() {
101: return _operation;
102: }
103:
104: public void generateJava(JavaWriter out) throws IOException {
105: out.println("@WebMethod");
106: //out.println("@WebResult");
107: getOperation().generateJava(out);
108: }
109: }
|