You are viewing a plain text version of this content. The canonical link for it is here.
Posted to muse-commits@ws.apache.org by da...@apache.org on 2007/02/27 20:20:42 UTC

svn commit: r512368 - /webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java

Author: danj
Date: Tue Feb 27 11:20:41 2007
New Revision: 512368

URL: http://svn.apache.org/viewvc?view=rev&rev=512368
Log:
fixed copyright header comment and alphabetized latest changes.

Modified:
    webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java

Modified: webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java
URL: http://svn.apache.org/viewvc/webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java?view=diff&rev=512368&r1=512367&r2=512368
==============================================================================
--- webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java (original)
+++ webservices/muse/trunk/modules/muse-core/src/org/apache/muse/ws/wsdl/WsdlUtils.java Tue Feb 27 11:20:41 2007
@@ -1,5 +1,4 @@
-/*******************************************************************************
- * =============================================================================
+/*=============================================================================
  * Copyright 2006 The Apache Software Foundation
  * 
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
@@ -13,8 +12,7 @@
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  * License for the specific language governing permissions and limitations under
  * the License.
- * =============================================================================
- */
+ *=============================================================================*/
 
 package org.apache.muse.ws.wsdl;
 
@@ -564,6 +562,39 @@
         //
         return null;
     }
+    
+    /**
+     * Returns the first portType (in document order) that's found in a given
+     * WSDL or null if the WSDL contains no portTypes.
+     * 
+     * @param wsdl
+     *            The WSDL document to search
+     * @return The first portType encountered or null if the document contains
+     *         no portTypes
+     */
+    public static Element getFirstPortType(Node wsdl)
+    {        
+        if (wsdl == null)
+            throw new NullPointerException(_MESSAGES.get("NullWSDLDocument"));
+        
+        //
+        // find all the wsdl:portTypes
+        //
+        Element root = null;
+        
+        if (wsdl.getNodeType() == Node.ELEMENT_NODE)
+            root = (Element) wsdl;
+        
+        else
+            root = XmlUtils.getFirstElement(wsdl);
+        
+        Element[] portTypes = XmlUtils.getElements(root, PORT_TYPE_QNAME);
+        
+        if (portTypes.length == 0)
+            return null;
+        
+        return portTypes[0];
+    }
 
     public static QName getInputPartName(Operation op)
     {
@@ -681,41 +712,6 @@
         //
         String qname = returnValueElement.getAttribute(XsdUtils.REF);
         return XmlUtils.parseQName(qname, returnValueElement);
-    }
-
-    
-    /**
-     * Returns the first portType (in document order) that's found in a given WSDL or
-     * null if the WSDL contains no portTypes.
-     * 
-     * @param wsdl
-     * 			  The WSDL document to search
-     * @return The first portType encountered or null if the document contains no portTypes
-     */
-    public static Element getFirstPortType(Node wsdl) {
-    	
-    	if(wsdl == null) {
-    		throw new NullPointerException(_MESSAGES.get("NullWSDLDocument"));
-    	}
-    	
-        //
-        // find all the wsdl:portTypes
-        //
-        Element root = null;
-
-        if (wsdl.getNodeType() == Node.ELEMENT_NODE)
-            root = (Element)wsdl;
-
-        else
-            root = XmlUtils.getFirstElement(wsdl);
-
-        Element[] portTypes = XmlUtils.getElements(root, PORT_TYPE_QNAME);
-        
-        if(portTypes.length == 0) {
-        	return null;
-        }
-        
-    	return portTypes[0];
     }
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: muse-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: muse-commits-help@ws.apache.org