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 ae...@apache.org on 2007/02/26 15:36:35 UTC

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

Author: aeberbac
Date: Mon Feb 26 06:36:34 2007
New Revision: 511822

URL: http://svn.apache.org/viewvc?view=rev&rev=511822
Log:
MUSE-171: Added metadata support to the tooling. This means that 
wsdlmerge now will merge metadata documents referenced from the list of
wsdls to merge. Also the code generation takes in metadata documents
if they are available. Currently only the proxy generator pays attention
to metadata, I'll update the server synthesizer. Also moved the copyProperty
stuff out of the MetadataDescriptor and into wsdlmerge, thanks Dan.

Also added a MuseRuntimeException which subclasses RuntimeException and
captures the message id of the error. This is for automated testing
to make sure that error messages are the correct ones.

MUSE-161: Added a WsdlEnvironment that will go out and fetch remote files.

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=511822&r1=511821&r2=511822
==============================================================================
--- 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 Mon Feb 26 06:36:34 2007
@@ -683,6 +683,41 @@
         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];
+    }
+    
     /**
      * 
      * Searches a WSDL document for a portType defined with the given name.



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