axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From barre...@apache.org
Subject svn commit: r474901 - in /webservices/axis2/trunk/java/modules/jaxws: src/org/apache/axis2/jaxws/description/ src/org/apache/axis2/jaxws/description/impl/ src/org/apache/axis2/jaxws/description/validator/ test-resources/wsdl/ test/org/apache/axis2/jaxw...
Date Tue, 14 Nov 2006 18:15:07 GMT
Author: barrettj
Date: Tue Nov 14 10:15:06 2006
New Revision: 474901

URL: http://svn.apache.org/viewvc?view=rev&rev=474901
Log:
Add Description validator classes and initial post-construction validation

Added:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointInterfaceDescriptionValidator.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/OperationDescriptionValidator.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ValidationFailures.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/Validator.java
    webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ValidateWSDL1.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ValidateWSDLTests.java
Modified:
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescription.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescriptionWSDL.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointInterfaceDescriptionWSDL.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
    webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescription.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescription.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescription.java Tue Nov 14 10:15:06 2006
@@ -70,6 +70,7 @@
     public abstract boolean isProviderBased();
     public abstract boolean isEndpointBased();
     
+    public abstract String getName();
     public abstract String getTargetNamespace();
     public abstract String getBindingType();
     public abstract List<String> getHandlerList();

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescriptionWSDL.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescriptionWSDL.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescriptionWSDL.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointDescriptionWSDL.java Tue Nov 14 10:15:06 2006
@@ -18,10 +18,20 @@
  */
 package org.apache.axis2.jaxws.description;
 
+import javax.wsdl.Binding;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+
 /**
  * 
  */
 public interface EndpointDescriptionWSDL {
+    
+    public Service getWSDLService();
+    public Port getWSDLPort();
+    public Binding getWSDLBinding();
+    public String getWSDLBindingType();
     
     /**
      * Is the WSDL definition fully specified for the endpoint (WSDL 1.1 port)

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointInterfaceDescriptionWSDL.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointInterfaceDescriptionWSDL.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointInterfaceDescriptionWSDL.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/EndpointInterfaceDescriptionWSDL.java Tue Nov 14 10:15:06 2006
@@ -18,6 +18,10 @@
 */
 package org.apache.axis2.jaxws.description;
 
+import javax.wsdl.PortType;
+
 public interface EndpointInterfaceDescriptionWSDL {
+    
+    public PortType getWSDLPortType();
     
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/ServiceDescriptionWSDL.java Tue Nov 14 10:15:06 2006
@@ -2,6 +2,8 @@
 
 import java.net.URL;
 
+import javax.wsdl.Definition;
+
 import org.apache.axis2.jaxws.util.WSDLWrapper;
 
 public interface ServiceDescriptionWSDL {
@@ -10,5 +12,8 @@
     public abstract WSDLWrapper getGeneratedWsdlWrapper();
 
     public abstract URL getWSDLLocation();
+    
+    public Definition getWSDLDefinition();
+    public boolean isWSDLSpecified();
 
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/DescriptionFactoryImpl.java Tue Nov 14 10:15:06 2006
@@ -35,6 +35,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.validator.ServiceDescriptionValidator;
 import org.apache.axis2.jaxws.description.ServiceDescription;
 
 /**
@@ -76,7 +77,15 @@
                 // process this impl class
                 ServiceDescription serviceDescription = new ServiceDescriptionImpl(
                         dbcMap, serviceImplComposite);
-                serviceDescriptionList.add(serviceDescription);
+                ServiceDescriptionValidator validator = new ServiceDescriptionValidator(serviceDescription);
+                if (validator.validate()) {
+                    serviceDescriptionList.add(serviceDescription);
+                }
+                else {
+                    // TODO: Validate all service descriptions before failing
+                    // TODO: Get more detailed failure information from the Validator
+                    throw ExceptionFactory.makeWebServiceException("ServiceDescription did not validate correctly");
+                }
             }
         }
 

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointDescriptionImpl.java Tue Nov 14 10:15:06 2006
@@ -26,8 +26,10 @@
 import java.util.StringTokenizer;
 
 import javax.jws.WebService;
+import javax.wsdl.Binding;
 import javax.wsdl.Definition;
 import javax.wsdl.Port;
+import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 import javax.xml.ws.BindingType;
 import javax.xml.ws.Service;
@@ -50,6 +52,7 @@
 import org.apache.axis2.jaxws.description.EndpointDescriptionWSDL;
 import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
 import org.apache.axis2.jaxws.description.ServiceDescription;
+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.i18n.Messages;
@@ -67,6 +70,7 @@
  * somehow from an AxisService/AxisPort combination, and not directly from the WSDL.
  */
 class EndpointDescriptionImpl implements EndpointDescription, EndpointDescriptionJava, EndpointDescriptionWSDL {
+    
     private ServiceDescriptionImpl parentServiceDescription;
     private AxisService axisService;
 
@@ -234,8 +238,7 @@
         //      Remember that this will only happen when we generate an AxisService from existing
         //		WSDL and then need to perform further processing because we have annotations as well
         //		If there is no WSDL, we would never process the Method to begin with.
-
-       
+        
         buildDescriptionHierachy();
         
         //Invoke the callback for generating the wsdl
@@ -551,7 +554,7 @@
         //Save the Port Type name
         Parameter portTypeNameParameter = new Parameter();
         portTypeNameParameter.setName(MDQConstants.WSDL_PORTTYPE_NAME);
-        portTypeNameParameter.setValue(getAnnoWebServiceName());
+        portTypeNameParameter.setValue(getName());
         
         // Save the Service QName as a parameter.
         Parameter serviceNameParameter = new Parameter();
@@ -602,7 +605,7 @@
     		else 
     			serviceBuilder.setServerSide(false);
     		
-    		axisService = serviceBuilder.populateService();    		
+    		axisService = serviceBuilder.populateService();
     		axisService.setName(createAxisServiceName());
             isBuiltFromWSDL = true;
     	} catch (AxisFault e) {
@@ -1073,11 +1076,6 @@
         return getAnnoServiceModeValue();
     }
     
-    public String getTargetNamespace() {
-        // TODO: (JLB) WSDL/Anno Merge
-        return getAnnoWebServiceTargetNamespace();
-    }
-    
     public Service.Mode getAnnoServiceModeValue() {
         // This annotation is only valid on Provider-based endpoints. 
         if (isProviderBased() && serviceModeValue == null) {
@@ -1141,7 +1139,50 @@
     public List<String> getHandlerList() {
         return handlerList;
     }
-    
+    private Definition getWSDLDefinition() {
+        return ((ServiceDescriptionWSDL) getServiceDescription()).getWSDLDefinition();
+    }
+    public javax.wsdl.Service getWSDLService() {
+        Definition defn = getWSDLDefinition();
+        if (defn != null) {
+            return defn.getService(getServiceQName());
+        }
+        else {
+            return null;
+        }
+    }
+    public Port getWSDLPort() {
+        javax.wsdl.Service service = getWSDLService();
+        if (service != null) {
+            return service.getPort(getPortQName().getLocalPart());
+        }
+        else {
+            return null;
+        }
+    }
+    public Binding getWSDLBinding() {
+        Binding wsdlBinding = null;
+        Port wsdlPort = getWSDLPort();
+        Definition wsdlDef = getWSDLDefinition();
+        if (wsdlPort != null && wsdlDef != null) {
+            wsdlBinding = wsdlPort.getBinding();
+        }
+        return wsdlBinding;
+    }
+    public String getWSDLBindingType() {
+        String wsdlBindingType = null;
+        Binding wsdlBinding = getWSDLBinding();
+        if (wsdlBinding != null) {
+            wsdlBindingType = wsdlBinding.getQName().getNamespaceURI();
+        }
+        return wsdlBindingType;
+    }
+    public String getName() {
+        return getAnnoWebServiceName();
+    }
+    public String getTargetNamespace() {
+        return getAnnoWebServiceTargetNamespace();
+    }
     /**
      * Returns the packages that are needed to marshal/unmarshal the 
      * data objects.  Example: this set of packages is used to construct a 

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/EndpointInterfaceDescriptionImpl.java Tue Nov 14 10:15:06 2006
@@ -25,16 +25,21 @@
 import java.util.List;
 
 import javax.jws.soap.SOAPBinding;
+import javax.wsdl.Binding;
+import javax.wsdl.Definition;
+import javax.wsdl.PortType;
 import javax.xml.namespace.QName;
 
 import org.apache.axis2.description.AxisOperation;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.jaxws.ExceptionFactory;
 import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionWSDL;
 import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
 import org.apache.axis2.jaxws.description.EndpointInterfaceDescriptionJava;
 import org.apache.axis2.jaxws.description.EndpointInterfaceDescriptionWSDL;
 import org.apache.axis2.jaxws.description.OperationDescription;
+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;
@@ -119,8 +124,8 @@
      * @param parent
      */
     EndpointInterfaceDescriptionImpl(   DescriptionBuilderComposite dbc, 
-                                    	boolean isClass,
-                                    	EndpointDescriptionImpl parent){
+                                    boolean isClass,
+                                    EndpointDescriptionImpl parent){
         
         parentEndpointDescription = parent;
         this.dbc = dbc;
@@ -614,6 +619,25 @@
         }
                 
         return retrieveList;
+    }
+
+    private Definition getWSDLDefinition() {
+        return ((ServiceDescriptionWSDL) getEndpointDescription().getServiceDescription()).getWSDLDefinition();
+    }
+    public PortType getWSDLPortType() {
+        PortType portType = null;
+//        EndpointDescriptionWSDL endpointDescWSDL = (EndpointDescriptionWSDL) getEndpointDescription();
+//        Binding wsdlBinding = endpointDescWSDL.getWSDLBinding();
+//        if (wsdlBinding != null) {
+//            portType = wsdlBinding.getPortType();
+//        }
+        Definition wsdlDefn = getWSDLDefinition();
+        if (wsdlDefn != null) {
+            String tns = getEndpointDescription().getTargetNamespace();
+            String localPart = getEndpointDescription().getName();
+            portType = wsdlDefn.getPortType(new QName(tns, localPart));
+        }
+        return portType;
     }
 
 }

Modified: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/impl/ServiceDescriptionImpl.java Tue Nov 14 10:15:06 2006
@@ -143,6 +143,7 @@
     	
 		// Do a first pass validation for this DescriptionBuilderComposite.
     	// This is not intended to be a full integrity check, but rather a fail-fast mechanism
+        // TODO: Refactor this to a seperate validator class?
     	validateDBCLIntegrity();
     	
         // The ServiceQName instance variable is set based on annotation or default
@@ -155,7 +156,6 @@
         // it will be set to the annotation value.
         //EndpointDescription endpointDescription = new EndpointDescription(null, this, serviceImplName);
         EndpointDescriptionImpl endpointDescription = new EndpointDescriptionImpl(this, serviceImplName);
-        
         addEndpointDescription(endpointDescription);       
     }
     
@@ -782,4 +782,16 @@
 	private void validateWSDLOperations() {
 		//Verifies that all operations on the wsdl are found in the impl/sei class
 	}
+
+    public boolean isWSDLSpecified() {
+        return getWSDLWrapper().getDefinition() != null;
+    }
+
+    public Definition getWSDLDefinition() {
+        Definition defn = null;
+        if (getWSDLWrapper() != null) {
+            defn = getWSDLWrapper().getDefinition();
+        }
+        return defn;
+    }
 }

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointDescriptionValidator.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+import javax.wsdl.Port;
+import javax.wsdl.Service;
+
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionJava;
+import org.apache.axis2.jaxws.description.EndpointDescriptionWSDL;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
+import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
+import org.apache.axis2.jaxws.description.validator.Validator.ValidationLevel;
+
+/**
+ * 
+ */
+public class EndpointDescriptionValidator extends Validator {
+    EndpointDescription endpointDesc;
+    EndpointDescriptionJava endpointDescJava;
+    EndpointDescriptionWSDL endpointDescWSDL;
+    
+    public EndpointDescriptionValidator(EndpointDescription toValidate) {
+        endpointDesc = toValidate;
+        endpointDescJava = (EndpointDescriptionJava) endpointDesc;
+        endpointDescWSDL = (EndpointDescriptionWSDL) endpointDesc;
+    }
+    
+    public boolean validate() {
+
+        if (getValidationLevel() == ValidationLevel.OFF) {
+            return VALID;
+        }
+
+        if (!validateWSDLPort()) {
+            return INVALID;
+        }
+        
+        if (!validateWSDLBindingType()) {
+            return INVALID;
+        }
+        
+        if (!validateEndpointInterface()) {
+            return INVALID;
+        }
+        return VALID;
+    }
+
+    private boolean validateWSDLBindingType() {
+        // TODO: The getWSDLBindingType is not getting the correct value; it needs to return the
+        //       <soap:binding transport> value
+        if (true) return VALID;
+        String bindingType = endpointDesc.getBindingType();
+        String wsdlBindingType = endpointDescWSDL.getWSDLBindingType();
+        if (wsdlBindingType != null && !wsdlBindingType.equals(bindingType)) {
+            addValidationFailure(this, "Binding type is invald");
+            return INVALID;
+        }
+        return VALID;
+    }
+
+    private boolean validateWSDLPort() {
+        // VALIDATION: If the service is specified in the WSDL, then the port must also be specified.
+        //             If the service is NOT in the WSDL, then this is "partial wsdl" and there is nothing to validate
+        //             against the WSDL
+        Service wsdlService = endpointDescWSDL.getWSDLService();
+        if (wsdlService != null) {
+            Port wsdlPort = endpointDescWSDL.getWSDLPort();
+            if (wsdlPort == null) {
+                addValidationFailure(this, "Serivce exists in WSDL, but Port does not.  Not a valid Partial WSDL");
+                return INVALID;
+            }
+        }
+        return VALID;
+    }
+    
+    private boolean validateEndpointInterface() {
+        EndpointInterfaceDescription eid = endpointDesc.getEndpointInterfaceDescription();
+        if (eid != null) {
+            EndpointInterfaceDescriptionValidator eidValidator = new EndpointInterfaceDescriptionValidator(eid);
+            boolean isEndpointInterfaceValid = eidValidator.validate();
+            if (!isEndpointInterfaceValid) {
+                addValidationFailure(eidValidator, "Invalid Endpoint Interface");
+                return INVALID;
+            }
+        }
+        return VALID;
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointInterfaceDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointInterfaceDescriptionValidator.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointInterfaceDescriptionValidator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/EndpointInterfaceDescriptionValidator.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+import java.util.List;
+
+import javax.wsdl.Binding;
+import javax.wsdl.Operation;
+import javax.wsdl.PortType;
+
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.EndpointDescriptionWSDL;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescription;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescriptionJava;
+import org.apache.axis2.jaxws.description.EndpointInterfaceDescriptionWSDL;
+import org.apache.axis2.jaxws.description.OperationDescription;
+import org.apache.axis2.jaxws.description.validator.Validator.ValidationLevel;
+
+/**
+ * 
+ */
+public class EndpointInterfaceDescriptionValidator extends Validator {
+    EndpointInterfaceDescription epInterfaceDesc;
+    EndpointInterfaceDescriptionJava epInterfaceDescJava;
+    EndpointInterfaceDescriptionWSDL epInterfaceDescWSDL;
+
+    public EndpointInterfaceDescriptionValidator(EndpointInterfaceDescription toValidate) {
+        epInterfaceDesc = toValidate;
+        epInterfaceDescJava = (EndpointInterfaceDescriptionJava) epInterfaceDesc;
+        epInterfaceDescWSDL = (EndpointInterfaceDescriptionWSDL) epInterfaceDesc;
+        
+    }
+    /* (non-Javadoc)
+     * @see org.apache.axis2.jaxws.description.validator.Validator#validate()
+     */
+    @Override
+    public boolean validate() {
+        if (getValidationLevel() == ValidationLevel.OFF) {
+            return VALID;
+        }
+        if (!validateSEIvsWSDLPortType()) {
+            return INVALID;
+        }
+        if (!validateSEIvsImplementation()) {
+            return INVALID;
+        }
+        return VALID;
+    }
+    
+    private boolean validateSEIvsWSDLPortType() {
+        PortType portType = epInterfaceDescWSDL.getWSDLPortType();
+        if (portType != null) {
+            // TODO: Need more validation here, including: operation name, parameters, faults
+            List wsdlOperationList = portType.getOperations(); 
+            OperationDescription[] opDescArray = epInterfaceDesc.getOperations();
+            if (wsdlOperationList.size() != opDescArray.length) {
+                addValidationFailure(this, "Operations did not match WSDL");
+                return INVALID;
+            }
+        }
+        return VALID;
+    }
+    private boolean validateSEIvsImplementation() {
+        // REVIEW: This level of validation is currently being done by the DBC Composite validation
+        return VALID;
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/OperationDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/OperationDescriptionValidator.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/OperationDescriptionValidator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/OperationDescriptionValidator.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+import org.apache.axis2.jaxws.description.OperationDescription;
+import org.apache.axis2.jaxws.description.OperationDescriptionJava;
+import org.apache.axis2.jaxws.description.OperationDescriptionWSDL;
+import org.apache.axis2.jaxws.description.validator.Validator.ValidationLevel;
+
+/**
+ * 
+ */
+public class OperationDescriptionValidator extends Validator {
+    private OperationDescription opDesc;
+    private OperationDescriptionJava opDescJava;
+    private OperationDescriptionWSDL opDescWSDL;
+
+
+    public OperationDescriptionValidator(OperationDescription toValidate) {
+        opDesc = toValidate;
+        opDescJava = (OperationDescriptionJava) opDesc;
+        opDescWSDL = (OperationDescriptionWSDL) opDesc;
+    }
+    /* (non-Javadoc)
+     * @see org.apache.axis2.jaxws.description.validator.Validator#validate()
+     */
+    @Override
+    public boolean validate() {
+        if (getValidationLevel() == ValidationLevel.OFF) {
+            return VALID;
+        }
+
+        // TODO Auto-generated method stub
+        return VALID;
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ServiceDescriptionValidator.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.axis2.jaxws.description.EndpointDescription;
+import org.apache.axis2.jaxws.description.ServiceDescription;
+import org.apache.axis2.jaxws.description.ServiceDescriptionJava;
+import org.apache.axis2.jaxws.description.ServiceDescriptionWSDL;
+
+/**
+ * 
+ */
+public class ServiceDescriptionValidator extends Validator {
+    
+    private ServiceDescription serviceDesc;
+    private ServiceDescriptionJava serviceDescJava;
+    private ServiceDescriptionWSDL serviceDescWSDL;
+    
+    public ServiceDescriptionValidator(ServiceDescription toValidate) {
+        serviceDesc = toValidate;
+        serviceDescJava = (ServiceDescriptionJava) serviceDesc;
+        serviceDescWSDL = (ServiceDescriptionWSDL) serviceDesc;
+    }
+    
+    /**
+     * Validate the ServiceDescription as follows
+     * 1) Validate that annotations and whatever WSDL is specified is valid
+     * 2) Validate that Java implementations are correc
+     *    a) Service Implementations match SEIs if specified
+     *    b) Operations match SEI methods
+     *    
+     * @return true if the ServiceDescription is valid
+     */
+    public boolean validate() {
+        if (getValidationLevel() == ValidationLevel.OFF) {
+            return VALID;
+        }
+        
+        if (!validateEndpointDescriptions()) {
+            return INVALID;
+        }
+        
+        return VALID;
+    }
+    
+    private boolean validateEndpointDescriptions() {
+        boolean areAllValid = true;
+        // Validate all the Endpoints that were created under this Service Description
+        EndpointDescription[] endpointDescArray = serviceDesc.getEndpointDescriptions();
+        for (EndpointDescription endpointDesc:endpointDescArray) {
+            EndpointDescriptionValidator endpointValidator = new EndpointDescriptionValidator(endpointDesc);
+            boolean isEndpointValid = endpointValidator.validate();
+            if (!isEndpointValid) {
+                addValidationFailure(endpointValidator, "Endpoint failed validation");
+                areAllValid = false;
+            }
+        }
+        return areAllValid;
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ValidationFailures.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ValidationFailures.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ValidationFailures.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/ValidationFailures.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+import java.util.ArrayList;
+
+
+/**
+ * 
+ */
+public class ValidationFailures {
+
+    ArrayList <ValidationFailure> validationFailures = new ArrayList<ValidationFailure>();
+    
+    public void add(Validator failingValidator, String message) {
+        validationFailures.add(new ValidationFailure(failingValidator, message));
+    }
+}
+
+class ValidationFailure {
+    Validator validator;
+    String message;
+    
+    ValidationFailure(Validator validator, String message) {
+        this.validator = validator;
+        this.message = message;
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/Validator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/Validator.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/Validator.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/src/org/apache/axis2/jaxws/description/validator/Validator.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description.validator;
+
+/**
+ * 
+ */
+public abstract class Validator {
+    public enum ValidationLevel {OFF, FULL};
+    public static final boolean VALID = true;
+    public static final boolean INVALID = false;
+    
+    private ValidationFailures validationFailures = new ValidationFailures();
+    // TODO: turn on validation and change the ValidateWSDL test to start checking for failures.
+    private ValidationLevel validationLevel = ValidationLevel.FULL;
+
+    abstract public boolean validate();
+    
+    void addValidationFailure(Validator failingValidator, String message) {
+        validationFailures.add(failingValidator, message);
+    }
+    
+    ValidationLevel getValidationLevel() {
+        return validationLevel;
+    }
+
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ValidateWSDL1.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ValidateWSDL1.wsdl?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ValidateWSDL1.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/wsdl/ValidateWSDL1.wsdl Tue Nov 14 10:15:06 2006
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://serverPartial1.checkexception.webfault.annotations/" name="AddNumbersImplPartial1Service" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://serverPartial1.checkexception.webfault.annotations/" xmlns="http://schemas.xmlsoap.org/wsdl/">
+  <types>
+    <xsd:schema>
+      <xsd:import namespace="http://serverPartial1.checkexception.webfault.annotations/" schemaLocation="PartialWSDL1_schema.xsd"/>
+    </xsd:schema>
+  </types>
+  <message name="addTwoNumbers">
+    <part name="parameters" element="tns:addTwoNumbers"/>
+  </message>
+  <message name="addTwoNumbersResponse">
+    <part name="parameters" element="tns:addTwoNumbersResponse"/>
+  </message>
+  <message name="AddNegativeNumbersException">
+    <part name="fault" element="tns:AddNegativeNumbersException"/>
+  </message>
+  <portType name="ValidateWSDLImpl1">
+    <operation name="addTwoNumbers">
+      <input message="tns:addTwoNumbers"/>
+      <output message="tns:addTwoNumbersResponse"/>
+      <fault name="AddNegativeNumbersException" message="tns:AddNegativeNumbersException"/>
+    </operation>
+    <operation name="addTwoNumbers2">
+      <input message="tns:addTwoNumbers"/>
+      <output message="tns:addTwoNumbersResponse"/>
+      <fault name="AddNegativeNumbersException" message="tns:AddNegativeNumbersException"/>
+    </operation>
+  </portType>
+
+  <binding name="AddNumbersImplPartial1PortBinding" type="tns:ValidateWSDLImpl1">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+    <operation name="addTwoNumbers">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+      <fault name="AddNegativeNumbersException">
+        <soap:fault name="AddNegativeNumbersException" use="literal"/>
+      </fault>
+    </operation>
+    <operation name="addTwoNumbers2">
+      <soap:operation soapAction=""/>
+      <input>
+        <soap:body use="literal"/>
+      </input>
+      <output>
+        <soap:body use="literal"/>
+      </output>
+      <fault name="AddNegativeNumbersException">
+        <soap:fault name="AddNegativeNumbersException" use="literal"/>
+      </fault>
+    </operation>
+  </binding>
+  <service name="ValidateWSDLImpl1ServiceInvalidPort">
+    <port name="ValidateWSDLImpl1Port" binding="tns:AddNumbersImplPartial1PortBinding">
+      <soap:address location="http://@REPLACE_WITH_HOST_NAME@:@REPLACE_WITH_PORT_NUM@/webfaultchkexc/webfaultchkexcp1"/>
+    </port>
+  </service>
+  
+</definitions>
+

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ValidateWSDLTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ValidateWSDLTests.java?view=auto&rev=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ValidateWSDLTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/description/ValidateWSDLTests.java Tue Nov 14 10:15:06 2006
@@ -0,0 +1,164 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *      
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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.axis2.jaxws.description;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.jws.WebService;
+import javax.wsdl.Definition;
+import javax.xml.ws.WebServiceException;
+
+import org.apache.axis2.jaxws.description.builder.DescriptionBuilderComposite;
+import org.apache.axis2.jaxws.description.builder.MethodDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.ParameterDescriptionComposite;
+import org.apache.axis2.jaxws.description.builder.WebServiceAnnot;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests validation against the WSDL for invalid configurations
+ */
+public class ValidateWSDLTests extends TestCase {
+    
+    /**
+     * The SEI used by the service impl does not contain all the methods
+     * defined on the PortType
+     */
+    public void testValidatePortType() {
+        String wsdlRelativeLocation = "test-resources/wsdl/";
+        String wsdlFileName = "ValidateWSDL1.wsdl"; 
+        
+        String targetNamespace = "http://serverPartial1.checkexception.webfault.annotations/";
+        String wsdlLocation = wsdlRelativeLocation + wsdlFileName;
+
+        // Build up a DBC, including the WSDL Definition and the annotation information for the impl class.
+        DescriptionBuilderComposite dbc = new DescriptionBuilderComposite();
+        
+        URL wsdlURL = DescriptionTestUtils.getWSDLURL(wsdlFileName);
+        Definition wsdlDefn = DescriptionTestUtils.createWSDLDefinition(wsdlURL);
+        assertNotNull(wsdlDefn);
+        
+        WebServiceAnnot webServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+        assertNotNull(webServiceAnnot);
+        webServiceAnnot.setWsdlLocation(wsdlLocation);
+        webServiceAnnot.setTargetNamespace(targetNamespace);
+        
+        MethodDescriptionComposite mdc = new MethodDescriptionComposite();
+        mdc.setMethodName("addTwoNumbers");
+        mdc.setReturnType("int");
+        
+        ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
+        pdc1.setParameterType("int");
+        ParameterDescriptionComposite pdc2 = new ParameterDescriptionComposite();
+        pdc1.setParameterType("int");
+        
+        mdc.addParameterDescriptionComposite(pdc1);
+        mdc.addParameterDescriptionComposite(pdc2);
+        
+        dbc.addMethodDescriptionComposite(mdc);
+        dbc.setWebServiceAnnot(webServiceAnnot);
+        dbc.setClassName(ValidateWSDLImpl1.class.getName());
+        dbc.setWsdlDefinition(wsdlDefn);
+        dbc.setwsdlURL(wsdlURL);
+        
+        HashMap<String, DescriptionBuilderComposite> dbcMap = new HashMap<String, DescriptionBuilderComposite>();
+        dbcMap.put(ValidateWSDLImpl1.class.getName(), dbc);
+        
+        try {
+            List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+            fail();
+        }
+        catch (WebServiceException e) {
+            // Expected code path
+        }
+    }
+    
+    /**
+     * Reference a Port (which does not exist) under a Service that does.  This is not a 
+     * valid partial WSDL case and so is an error.
+     */
+    public void testValidatePort() {
+        String wsdlRelativeLocation = "test-resources/wsdl/";
+        String wsdlFileName = "ValidateWSDL1.wsdl"; 
+        
+        String targetNamespace = "http://serverPartial1.checkexception.webfault.annotations/";
+        String wsdlLocation = wsdlRelativeLocation + wsdlFileName;
+
+        // Build up a DBC, including the WSDL Definition and the annotation information for the impl class.
+        DescriptionBuilderComposite dbc = new DescriptionBuilderComposite();
+        
+        URL wsdlURL = DescriptionTestUtils.getWSDLURL(wsdlFileName);
+        Definition wsdlDefn = DescriptionTestUtils.createWSDLDefinition(wsdlURL);
+        assertNotNull(wsdlDefn);
+        
+        WebServiceAnnot webServiceAnnot = WebServiceAnnot.createWebServiceAnnotImpl();
+        assertNotNull(webServiceAnnot);
+        webServiceAnnot.setWsdlLocation(wsdlLocation);
+        webServiceAnnot.setTargetNamespace(targetNamespace);
+        webServiceAnnot.setServiceName("ValidateWSDLImpl1ServiceInvalidPort");
+        
+        MethodDescriptionComposite mdc = new MethodDescriptionComposite();
+        mdc.setMethodName("addTwoNumbers");
+        mdc.setReturnType("int");
+        
+        ParameterDescriptionComposite pdc1 = new ParameterDescriptionComposite();
+        pdc1.setParameterType("int");
+        ParameterDescriptionComposite pdc2 = new ParameterDescriptionComposite();
+        pdc1.setParameterType("int");
+        
+        mdc.addParameterDescriptionComposite(pdc1);
+        mdc.addParameterDescriptionComposite(pdc2);
+        
+        dbc.addMethodDescriptionComposite(mdc);
+        dbc.setWebServiceAnnot(webServiceAnnot);
+        dbc.setClassName(ValidateWSDLImpl2.class.getName());
+        dbc.setWsdlDefinition(wsdlDefn);
+        dbc.setwsdlURL(wsdlURL);
+        
+        HashMap<String, DescriptionBuilderComposite> dbcMap = new HashMap<String, DescriptionBuilderComposite>();
+        dbcMap.put(ValidateWSDLImpl1.class.getName(), dbc);
+        
+        try {
+            List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
+            fail();
+        }
+        catch (WebServiceException e) {
+            // Expected code path
+        }
+    }
+}
+
+@WebService(wsdlLocation = "test-resources/wsdl/ValidateWSDL2.wsdl",
+            targetNamespace = "http://serverPartial1.checkexception.webfault.annotations/")
+class ValidateWSDLImpl1 {
+    public int addTwoNumbers(int number1, int number2) {
+        return number1 + number2;
+    }
+}
+
+@WebService(serviceName = "ValidateWSDLImpl1ServiceInvalidPort",
+        wsdlLocation = "test-resources/wsdl/ValidateWSDL2.wsdl",
+        targetNamespace = "http://serverPartial1.checkexception.webfault.annotations/")
+class ValidateWSDLImpl2 {
+public int addTwoNumbers(int number1, int number2) {
+    return number1 + number2;
+}
+}

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=474901&r1=474900&r2=474901
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Tue Nov 14 10:15:06 2006
@@ -28,6 +28,7 @@
 import org.apache.axis2.jaxws.description.AnnotationServiceImplWithDBCTests;
 import org.apache.axis2.jaxws.description.PartialWSDLTests;
 import org.apache.axis2.jaxws.description.ServiceAnnotationTests;
+import org.apache.axis2.jaxws.description.ValidateWSDLTests;
 import org.apache.axis2.jaxws.description.WSDLDescriptionTests;
 import org.apache.axis2.jaxws.description.WSDLTests;
 import org.apache.axis2.jaxws.description.builder.DescriptionBuilderTests;
@@ -102,6 +103,7 @@
         suite.addTestSuite(AnnotationProviderImplDescriptionTests.class);
         suite.addTestSuite(AnnotationServiceImplWithDBCTests.class);
         suite.addTestSuite(PartialWSDLTests.class);
+        suite.addTestSuite(ValidateWSDLTests.class);
         
         suite.addTestSuite(HandlerChainProcessorTests.class);
         suite.addTestSuite(JaxwsMessageBundleTests.class);



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


Mime
View raw message