001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: package com.sun.xml.ws.api.model.wsdl;
038:
039: import com.sun.xml.ws.api.model.wsdl.WSDLExtensible;
040: import com.sun.istack.NotNull;
041: import com.sun.istack.Nullable;
042:
043: import javax.xml.namespace.QName;
044:
045: /**
046: * Provides abstraction of wsdl:portType/wsdl:operation.
047: *
048: * @author Vivek Pandey
049: */
050: public interface WSDLOperation extends WSDLObject, WSDLExtensible {
051: /**
052: * Gets the name of the wsdl:portType/wsdl:operation@name attribute value as local name and wsdl:definitions@targetNamespace
053: * as the namespace uri.
054: */
055: @NotNull
056: QName getName();
057:
058: /**
059: * Gets the wsdl:input of this operation
060: */
061: @NotNull
062: WSDLInput getInput();
063:
064: /**
065: * Gets the wsdl:output of this operation.
066: *
067: * @return
068: * null if this is an one-way operation.
069: */
070: @Nullable
071: WSDLOutput getOutput();
072:
073: /**
074: * Returns true if this operation is an one-way operation.
075: */
076: boolean isOneWay();
077:
078: /**
079: * Gets the {@link WSDLFault} corresponding to wsdl:fault of this operation.
080: */
081: Iterable<? extends WSDLFault> getFaults();
082:
083: /**
084: * Gives {@link WSDLFault} for the given soap fault detail value.
085: *
086: * <pre>
087: *
088: * Given a wsdl fault:
089: *
090: * <wsdl:message nae="faultMessage">
091: * <wsdl:part name="fault" element="<b>ns:myException</b>/>
092: * </wsdl:message>
093: *
094: * <wsdl:portType>
095: * <wsdl:operation ...>
096: * <wsdl:fault name="aFault" message="faultMessage"/>
097: * </wsdl:operation>
098: * <wsdl:portType>
099: *
100: *
101: * For example given a soap 11 soap message:
102: *
103: * <soapenv:Fault>
104: * ...
105: * <soapenv:detail>
106: * <<b>ns:myException</b>>
107: * ...
108: * </ns:myException>
109: * </soapenv:detail>
110: *
111: * QName faultQName = new QName(ns, "myException");
112: * WSDLFault wsdlFault = getFault(faultQName);
113: *
114: * The above call will return a WSDLFault that abstracts wsdl:portType/wsdl:operation/wsdl:fault.
115: *
116: * </pre>
117: *
118: * @param faultDetailName tag name of the element inside soaenv:Fault/detail/, must be non-null.
119: * @return returns null if a wsdl fault corresponding to the detail entry name not found.
120: */
121: @Nullable
122: WSDLFault getFault(QName faultDetailName);
123:
124: /**
125: * Gives the enclosing wsdl:portType@name attribute value.
126: */
127: @NotNull
128: QName getPortTypeName();
129: }
|