View Javadoc
1   /*
2    * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3    * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4    *
5    * This code is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License version 2 only, as
7    * published by the Free Software Foundation.  Oracle designates this
8    * particular file as subject to the "Classpath" exception as provided
9    * by Oracle in the LICENSE file that accompanied this code.
10   *
11   * This code is distributed in the hope that it will be useful, but WITHOUT
12   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   * version 2 for more details (a copy is included in the LICENSE file that
15   * accompanied this code).
16   *
17   * You should have received a copy of the GNU General Public License version
18   * 2 along with this work; if not, write to the Free Software Foundation,
19   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20   *
21   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22   * or visit www.oracle.com if you need additional information or have any
23   * questions.
24   */
25  
26  package com.sun.xml.internal.ws.api.model.wsdl;
27  
28  import com.sun.xml.internal.ws.api.model.wsdl.WSDLExtensible;
29  import com.sun.istack.internal.NotNull;
30  import com.sun.istack.internal.Nullable;
31  
32  import javax.xml.namespace.QName;
33  
34  /**
35   * Provides abstraction of wsdl:portType/wsdl:operation.
36   *
37   * @author Vivek Pandey
38   */
39  public interface WSDLOperation extends WSDLObject, WSDLExtensible {
40      /**
41       * Gets the name of the wsdl:portType/wsdl:operation@name attribute value as local name and wsdl:definitions@targetNamespace
42       * as the namespace uri.
43       */
44      @NotNull QName getName();
45  
46      /**
47       * Gets the wsdl:input of this operation
48       */
49      @NotNull WSDLInput getInput();
50  
51      /**
52       * Gets the wsdl:output of this operation.
53       *
54       * @return
55       *      null if this is an one-way operation.
56       */
57      @Nullable WSDLOutput getOutput();
58  
59      /**
60       * Returns true if this operation is an one-way operation.
61       */
62      boolean isOneWay();
63  
64      /**
65       * Gets the {@link WSDLFault} corresponding to wsdl:fault of this operation.
66       */
67      Iterable<? extends WSDLFault> getFaults();
68  
69      /**
70       * Gives {@link WSDLFault} for the given soap fault detail value.
71       *
72       * <pre>
73       *
74       * Given a wsdl fault:
75       *
76       * &lt;wsdl:message nae="faultMessage">
77       *  &lt;wsdl:part name="fault" element="<b>ns:myException</b>/>
78       * &lt;/wsdl:message>
79       *
80       * &lt;wsdl:portType>
81       *  &lt;wsdl:operation ...>
82       *      &lt;wsdl:fault name="aFault" message="faultMessage"/>
83       *  &lt;/wsdl:operation>
84       * &lt;wsdl:portType>
85       *
86       *
87       * For example given a soap 11 soap message:
88       *
89       * &lt;soapenv:Fault>
90       *      ...
91       *      &lt;soapenv:detail>
92       *          &lt;<b>ns:myException</b>>
93       *              ...
94       *          &lt;/ns:myException>
95       *      &lt;/soapenv:detail>
96       *
97       * QName faultQName = new QName(ns, "myException");
98       * WSDLFault wsdlFault  = getFault(faultQName);
99       *
100      * The above call will return a WSDLFault that abstracts wsdl:portType/wsdl:operation/wsdl:fault.
101      *
102      * </pre>
103      *
104      * @param faultDetailName tag name of the element inside soaenv:Fault/detail/, must be non-null.
105      * @return returns null if a wsdl fault corresponding to the detail entry name not found.
106      */
107     @Nullable WSDLFault getFault(QName faultDetailName);
108 
109     /**
110      * Gives the enclosing wsdl:portType@name attribute value.
111      */
112     @NotNull QName getPortTypeName();
113 
114     /**
115      * Returns parameter order
116      * @return Parameter order
117      */
118     public String getParameterOrder();
119 }