You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sc...@apache.org on 2007/01/25 19:47:05 UTC

svn commit: r499893 - in /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl: EndpointDescriptionImpl.java ServiceDescriptionImpl.java

Author: scheu
Date: Thu Jan 25 10:47:04 2007
New Revision: 499893

URL: http://svn.apache.org/viewvc?view=rev&rev=499893
Log:
AXIS2-2028
Contributor:Roy Wood
Bug fix for improper placement of wsdl definition

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?view=diff&rev=499893&r1=499892&r2=499893
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Thu Jan 25 10:47:04 2007
@@ -302,30 +302,8 @@
 			DescriptionBuilderComposite seic = 
 					getServiceDescriptionImpl().getDBCMap().get(composite.getWebServiceAnnot().endpointInterface());
 	
-			//TODO: This functionality is intended to fix the bug that potentially places the 
-			// wsdlDefinition on the wrong composite. This code should be moved to 
-			// ServiceDescriptionImpl.setupWsdlDefinition() eventually
-			try { 
-				WSDL4JWrapper wsdl4jWrapper = null;
-
-				if (seic.getWsdlDefinition() != null) {
-					//set the sdimpl from the SEI composite
-					wsdl4jWrapper = new WSDL4JWrapper(seic.getWsdlURL(), seic.getWsdlDefinition());
-					getServiceDescriptionImpl().setWsdlWrapper(wsdl4jWrapper);
-				} else if (composite.getWsdlDefinition() != null) {
-					//set the sdimpl from the impl. class composite
-					wsdl4jWrapper = new WSDL4JWrapper(composite.getWsdlURL(), composite.getWsdlDefinition());
-					getServiceDescriptionImpl().setWsdlWrapper(wsdl4jWrapper);
-				} 
-				else {
-					wsdlComposite = generateWSDL(composite);
-				}
-			} catch (WSDLException e) {
-				throw ExceptionFactory.makeWebServiceException(Messages.getMessage("wsdlException", e.getMessage()), e);
-			}
-			
-			//If this is not null, then we don't bother generating wsdl
 			
+			//Only generate WSDL if a definition doesn't already exist
 			if (seic.getWsdlDefinition() == null)	
 				wsdlComposite = generateWSDL(composite);	
     	}

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=499893&r1=499892&r2=499893
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Thu Jan 25 10:47:04 2007
@@ -407,24 +407,51 @@
     	
     	if (isDBCMap()) {
 
-    		//TODO: Currently, there is a bug which allows the wsdlDefinition to be placed
+    		//  Currently, there is a bug which allows the wsdlDefinition to be placed
     		//  on either the impl class composite or the sei composite, or both. We need to 
-    		//  look in both places and find the correct one, if it exists. There is a patch 
-    		//  in EndpointDescriptionImpl constructor which will reset the wsdlWrapper, if necessary. But
-    		//  that functionality should be moved here at some point.
+    		//  look in both places and find the correct one, if it exists.
 
-    		if (composite.getWsdlDefinition() != null) {
-    			this.wsdlURL = composite.getWsdlURL();
-                
-    			try {
-                    this.wsdlWrapper = new WSDL4JWrapper(this.wsdlURL, 
-                    				composite.getWsdlDefinition());
-
-                }
-    			catch (WSDLException e) {
-                    throw ExceptionFactory.makeWebServiceException(Messages.getMessage("wsdlException", e.getMessage()), e);
-                }
-    		}
+    	    if (((composite.getWebServiceAnnot() != null) && 
+    	          DescriptionUtils.isEmpty(composite.getWebServiceAnnot().endpointInterface()))  	                    
+    	               || 
+    	          (!(composite.getWebServiceProviderAnnot() == null))) {
+    	        //This is either an implicit SEI, or a WebService Provider
+    	        if (composite.getWsdlDefinition() != null) {
+    	            this.wsdlURL = composite.getWsdlURL();
+    	            
+    	            try {
+    	                this.wsdlWrapper = new WSDL4JWrapper(this.wsdlURL, 
+    	                        composite.getWsdlDefinition());
+    	            } catch (WSDLException e) {
+    	                throw ExceptionFactory.makeWebServiceException(Messages.getMessage("wsdlException", e.getMessage()), e);
+    	            }
+    	        }
+    	        
+    	    } else if (composite.getWebServiceAnnot() != null) {
+    	        //This impl class specifies an SEI...this is a special case. There is a bug
+    	        //in the tooling that allows for the wsdllocation to be specifed on either the
+    	        //impl. class, or the SEI, or both. So, we need to look for the wsdl as follows:
+    	        //          1. If the Wsdl exists on the SEI, then check for it on the impl.
+    	        //          2. If it is not found in either location, in that order, then generate
+    	        
+    	        DescriptionBuilderComposite seic = 
+    	            getDBCMap().get(composite.getWebServiceAnnot().endpointInterface());
+    	        
+    	        try { 
+    	            if (seic.getWsdlDefinition() != null) {
+    	                //set the sdimpl from the SEI composite
+    	                this.wsdlURL = seic.getWsdlURL();
+    	                this.wsdlWrapper = new WSDL4JWrapper(seic.getWsdlURL(), seic.getWsdlDefinition());
+    	            } else if (composite.getWsdlDefinition() != null) {
+    	                //set the sdimpl from the impl. class composite
+    	                this.wsdlURL = composite.getWsdlURL();
+    	                this.wsdlWrapper = new WSDL4JWrapper(composite.getWsdlURL(), composite.getWsdlDefinition());
+    	            } 
+    	        } catch (WSDLException e) {
+    	            throw ExceptionFactory.makeWebServiceException(Messages.getMessage("wsdlException", e.getMessage()), e);
+    	        }
+    	    }           
+    	    
         //Deprecate this code block when MDQ is fully integrated
     	} else if (wsdlURL != null) {
             try {



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