You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by nt...@apache.org on 2010/08/30 23:27:15 UTC

svn commit: r990950 - /axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java

Author: nthaker
Date: Mon Aug 30 21:27:15 2010
New Revision: 990950

URL: http://svn.apache.org/viewvc?rev=990950&view=rev
Log:
Adding wsdl check before logging a warning message. When using new JAX-WS tooling runtime does not expose any operations not defined by wsdl, hence no warning is necessary when a wsdl is present in application.

Modified:
    axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java

Modified: axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java?rev=990950&r1=990949&r2=990950&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java (original)
+++ axis/axis2/java/core/trunk/modules/metadata/src/org/apache/axis2/jaxws/description/impl/PostRI216MethodRetrieverImpl.java Mon Aug 30 21:27:15 2010
@@ -23,8 +23,11 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.wsdl.Definition;
+
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.description.MethodRetriever;
+import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
 import org.apache.axis2.jaxws.description.builder.MDQConstants;
 import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
@@ -142,11 +145,12 @@ public class PostRI216MethodRetrieverImp
             Iterator<MethodDescriptionComposite> iter = retrieveList.iterator();
             while(iter.hasNext()){
                 MethodDescriptionComposite mdc = iter.next();
-                //If user defined a legacyWemethod, has atleast one operation with @Wemethod annotation
+                //If user defined a legacyWemethod with no wsdl, has atleast one operation with @Wemethod annotation
                 //and this is a public operation with no @Webmethod operation that is being exposed then
                 //lets warn user of possible security exposure.
-                if(getLegacyWebMethod()==null && isWebmethodDefined && mdc.getWebMethodAnnot()==null && !isConstructor(mdc)){                      
-                  log.warn(Messages.getMessage("MethodRetrieverWarning1", mdc.getMethodName()));                     
+                Definition wsdlDef = ((ServiceDescriptionWSDL)eid.getEndpointDescription().getServiceDescription()).getWSDLDefinition(); 
+                if(getLegacyWebMethod()==null && wsdlDef == null && isWebmethodDefined && mdc.getWebMethodAnnot()==null && !isConstructor(mdc)){
+                    log.warn(Messages.getMessage("MethodRetrieverWarning1", mdc.getMethodName()));
                 }
             }
         }//Done with implied SEI's