Author: ajith
Date: Tue Jul 18 03:38:24 2006
New Revision: 423041

URL: http://svn.apache.org/viewvc?rev=423041&view=rev
Log:
1. Changed the behavior of the typemapper to throw an exception when there is a 
QName reference that has no type.
2. Added a new exception that will be thrown in the mentioned situation.
3. Added a test case to the WSDL2JavaTest.java and the relevant WSDL file
4. Modified the WSDL11ToAxisServiceBuilder.java to populate the namespace 
imports to the existing schema if needed

Added:
    
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/UnmatchedTypeException.java
    
webservices/axis2/trunk/java/modules/xmlbeans/test-resources/unreferenced.wsdl
Modified:
    
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
    
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
    
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
    
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
    
webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java

Modified: 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java?rev=423041&r1=423040&r2=423041&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
 Tue Jul 18 03:38:24 2006
@@ -17,6 +17,7 @@
 package org.apache.axis2.wsdl.databinding;
 
 import org.apache.axis2.namespace.Constants;
+import org.apache.axis2.wsdl.i18n.CodegenMessages;
 import org.apache.axiom.om.OMElement;
 
 import javax.xml.namespace.QName;
@@ -32,7 +33,6 @@
      */
     protected String defaultClassName = OMElement.class.getName();
 
-    //todo get this from a constant
     protected static final String XSD_SCHEMA_URL = 
Constants.URI_2001_SCHEMA_XSD;
 
     //hashmap that contains the type mapping names
@@ -66,12 +66,21 @@
             Object o = qName2NameMap.get(qname);
             if (o != null) {
                 return (String) o;
-            } else {
+            } else if (Constants.XSD_ANYTYPE.equals(qname) ||
+                     Constants.XSD_ANY.equals(qname)) {
                 return defaultClassName;
+            }else{
+                throw new UnmatchedTypeException(
+                        
CodegenMessages.getMessage("databinding.typemapper.typeunmatched",
+                                qname.getLocalPart(),
+                                qname.getNamespaceURI())
+                );
             }
+        }else{
+           return null;
         }
 
-        return null;
+
     }
 
     /**

Added: 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/UnmatchedTypeException.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/UnmatchedTypeException.java?rev=423041&view=auto
==============================================================================
--- 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/UnmatchedTypeException.java
 (added)
+++ 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/UnmatchedTypeException.java
 Tue Jul 18 03:38:24 2006
@@ -0,0 +1,37 @@
+package org.apache.axis2.wsdl.databinding;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * A simple exception that will be thrown if a type is not matched!
+ */
+public class UnmatchedTypeException extends RuntimeException{
+
+    public UnmatchedTypeException() {
+    }
+
+    public UnmatchedTypeException(String message) {
+        super(message);
+    }
+
+    public UnmatchedTypeException(Throwable cause) {
+        super(cause);
+    }
+
+    public UnmatchedTypeException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Modified: 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties?rev=423041&r1=423040&r2=423041&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
 (original)
+++ 
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/i18n/resource.properties
 Tue Jul 18 03:38:24 2006
@@ -88,6 +88,10 @@
 emitter.switchingMessages=Warning -No services found - switched to the 
interface mode!
 emitter.warningMultiplePorttypes=Warning - Found multiple porttypes - picking 
the first
 
+# Type mappers
+databinding.typemapper.typeunmatched=No type was mapped to the name {0} with 
namespace {1}
+databinding.typemapper.typeunmatched.null=No type can be matched to a null 
QName!
+
 ##################### java2WSDL
 java2wsdl.arg1=Usage java2wsdl -cn <fully qualified class name> : class file 
name
 java2wsdl.arg2=-o <output Location> : output file location

Modified: 
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java?rev=423041&r1=423040&r2=423041&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL11ToAxisServiceBuilder.java
 Tue Jul 18 03:38:24 2006
@@ -1,7 +1,6 @@
 package org.apache.axis2.description;
 
 import com.ibm.wsdl.extensions.soap.SOAPConstants;
-import com.ibm.wsdl.util.xml.DOM2Writer;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.addressing.AddressingConstants;
 import org.apache.axis2.addressing.wsdl.WSDL11ActionHelper;
@@ -16,7 +15,6 @@
 import org.apache.ws.policy.PolicyReference;
 import org.apache.ws.policy.util.DOMPolicyReader;
 import org.apache.ws.policy.util.PolicyFactory;
-import org.apache.ws.commons.schema.XmlSchema;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
@@ -99,6 +97,12 @@
      */
     private List wrappableOperations = new ArrayList();
     public static final String WRAPPED_OUTPUTNAME_SUFFIX = "Response";
+    public static final String XML_NAMESPACE_URI = 
"http://www.w3.org/2000/xmlns/";;
+    public static final String NAMESPACE_DECLARATION_PREFIX = "xmlns:";
+
+    private static int prefixCounter = 0;
+    public static final String NAMESPACE_URI = "namespace";
+    public static final String TRAGET_NAMESPACE = "targetNamespace";
 
     /**
      * constructor taking in the service name and the port name
@@ -151,6 +155,7 @@
 
     /**
      * populates a given service
+     * This is the only publicly accessible method in this class
      *
      * @return
      * @throws AxisFault
@@ -202,7 +207,7 @@
             }
 
             //add the newly created schemas
-             if (schemaElements != null && schemaElements.length > 0) {
+            if (schemaElements != null && schemaElements.length > 0) {
                 for (int i = 0; i < schemaElements.length; i++) {
                     Element schemaElement = schemaElements[i];
                     if (schemaElement != null) {
@@ -242,7 +247,7 @@
             Object o =  typesExtensibilityElements.get(i);
             if (o instanceof Schema){
                 Schema s = (Schema)o;
-                String targetNamespace = 
s.getElement().getAttribute("targetNamespace");
+                String targetNamespace = 
s.getElement().getAttribute(TRAGET_NAMESPACE);
                 schemaMap.put(targetNamespace,s.getElement());
             }
         }
@@ -1059,7 +1064,7 @@
                             Element namespaceImport = document.createElementNS(
                                     XMLSCHEMA_NAMESPACE_URI, xsdPrefix + ":"
                                     + XML_SCHEMA_IMPORT_LOCAL_NAME);
-                            namespaceImport.setAttribute("namespace", uri);
+                            namespaceImport.setAttribute(NAMESPACE_URI, uri);
                             //add this to the map
                             namespaceImportsMap.put(uri, namespaceImport);
                             //we also need to associate this uri with a prefix
@@ -1183,14 +1188,19 @@
                     .keySet().toArray(new String[namespacePrefixMap.size()]);
             for (int i = 0; i < nameSpaceDeclarationArray.length; i++) {
                 String s = nameSpaceDeclarationArray[i];
-                //todo - look for the namespace decalarations first before
-                // declaring them
-                schemaElement.setAttributeNS("http://www.w3.org/2000/xmlns/";,
-                        "xmlns:" + namespacePrefixMap.get(s).toString(), s);
+                
checkAndAddNamespaceDeclarations(s,namespacePrefixMap,schemaElement);
+            }
 
+             //add imports  - check whether it is the targetnamespace before
+            // adding
+            Element[] namespaceImports = (Element[]) 
namespaceImportsMap.values()
+                    .toArray(new Element[namespaceImportsMap.size()]);
+            for (int i = 0; i < namespaceImports.length; i++) {
+                if 
(!namespaceURI.equals(namespaceImports[i].getAttribute(NAMESPACE_URI))){
+                    schemaElement.appendChild(namespaceImports[i]);
+                }
             }
 
-            //attach the namespace decalarations if they are not the 
targetnamespace
             Element[] elementDeclarations = (Element[]) elementElementsList
                     .toArray(new Element[elementElementsList.size()]);
             for (int i = 0; i < elementDeclarations.length; i++) {
@@ -1198,7 +1208,7 @@
                         importNode(elementDeclarations[i],true));
             }
 
-
+            //don't return anything!!
             return null;
         } else {
             // there is no element in the
@@ -1211,17 +1221,18 @@
                     .keySet().toArray(new String[namespacePrefixMap.size()]);
             for (int i = 0; i < nameSpaceDeclarationArray.length; i++) {
                 String s = nameSpaceDeclarationArray[i];
-                schemaElement.setAttributeNS("http://www.w3.org/2000/xmlns/";,
-                        "xmlns:" + namespacePrefixMap.get(s).toString(), s);
+                schemaElement.setAttributeNS(XML_NAMESPACE_URI,
+                        NAMESPACE_DECLARATION_PREFIX + 
namespacePrefixMap.get(s).toString(), s);
 
             }
 
             //add the targetNamespace
-            schemaElement.setAttributeNS("http://www.w3.org/2000/xmlns/";,
+            schemaElement.setAttributeNS(XML_NAMESPACE_URI,
                     XMLNS_AXIS2WRAPPED, namespaceURI);
             schemaElement.setAttribute(XSD_TARGETNAMESPACE, namespaceURI);
             schemaElement.setAttribute(XSD_ELEMENT_FORM_DEFAULT, 
XSD_UNQUALIFIED);
 
+            //add imports
             Element[] namespaceImports = (Element[]) 
namespaceImportsMap.values()
                     .toArray(new Element[namespaceImportsMap.size()]);
             for (int i = 0; i < namespaceImports.length; i++) {
@@ -1229,6 +1240,7 @@
 
             }
 
+            //add element declarations
             Element[] elementDeclarations = (Element[]) elementElementsList
                     .toArray(new Element[elementElementsList.size()]);
             for (int i = 0; i < elementDeclarations.length; i++) {
@@ -1243,6 +1255,46 @@
     }
 
     /**
+     *
+     * @param namespaceDeclaration
+     * @param prefixMap
+     */
+    private void checkAndAddNamespaceDeclarations(String namespace,
+                                                  Map prefixMap,
+                                                  Element schemaElement) {
+        //get the attribute for the current namespace
+        String prefix = (String)prefixMap.get(namespace);
+        //A prefix must be found at this point!
+        String existingURL = schemaElement.getAttributeNS(
+                XML_NAMESPACE_URI,
+                NAMESPACE_DECLARATION_PREFIX + prefix);
+        if (existingURL==null){
+            //there is no existing URL by that prefix - declare a new namespace
+            schemaElement.setAttributeNS(XML_NAMESPACE_URI,
+                    NAMESPACE_DECLARATION_PREFIX + prefix,
+                    namespace);
+        }else if (existingURL.equals(namespace)){
+            //this namespace declaration is already there with the same prefix
+            //ignore it
+        }else{
+            //there is a different namespace declared in the given prefix
+            //change the prefix in the prefix map to a new one and declare it
+
+            //create a prefix
+            String generatedPrefix = "ns" +prefixCounter++;
+            while(prefixMap.containsKey(generatedPrefix)){
+                generatedPrefix = "ns" +prefixCounter++;
+            }
+            schemaElement.setAttributeNS(XML_NAMESPACE_URI,
+                    NAMESPACE_DECLARATION_PREFIX + generatedPrefix,
+                    namespace);
+            //add to the map
+            prefixMap.put(generatedPrefix,namespace);
+        }
+
+    }
+
+    /**
      * The intention of this procedure is to process the imports. When
      * processing the imports the imported documents will be populating the
      * items in the main document recursivley
@@ -1264,8 +1316,8 @@
                         Definition importedDef = wsdlImport.getDefinition();
                         if (importedDef != null) {
                             processImports(importedDef);
-                            //copy ns
 
+                            //copy ns
                             Map namespaces = importedDef.getNamespaces();
                             Iterator keys = namespaces.keySet().iterator();
                             while (keys.hasNext()) {
@@ -1304,6 +1356,7 @@
                             //add bindings
                             Map bindingMap = importedDef.getBindings();
                             wsdl4JDefinition.getBindings().putAll(bindingMap);
+
                             //add services
                             Map serviceMap = importedDef.getServices();
                             wsdl4JDefinition.getServices().putAll(serviceMap);
@@ -1326,6 +1379,7 @@
     private Definition readInTheWSDLFile(InputStream in) throws WSDLException {
 
         WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
+        
         //switch off the verbose mode for all usecases
         reader.setFeature("javax.wsdl.verbose", false);
 
@@ -1686,7 +1740,7 @@
             }
         }
 
-        //if no SOAPBinding is not present just return an empty list
+        //if SOAPBinding is not present just return an empty list
         if (!isSOAPBinding) {
             return new ArrayList();
         }

Modified: 
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java?rev=423041&r1=423040&r2=423041&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/xmlbeans/src/org/apache/axis2/xmlbeans/CodeGenerationUtility.java
 Tue Jul 18 03:38:24 2006
@@ -99,7 +99,6 @@
                 return new DefaultTypeMapper();
             }
 
-
             SchemaTypeSystem sts;
             List completeSchemaList = new ArrayList();
             List topLevelSchemaList = new ArrayList();

Added: 
webservices/axis2/trunk/java/modules/xmlbeans/test-resources/unreferenced.wsdl
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/test-resources/unreferenced.wsdl?rev=423041&view=auto
==============================================================================
--- 
webservices/axis2/trunk/java/modules/xmlbeans/test-resources/unreferenced.wsdl 
(added)
+++ 
webservices/axis2/trunk/java/modules/xmlbeans/test-resources/unreferenced.wsdl 
Tue Jul 18 03:38:24 2006
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+       xmlns="http://schemas.xmlsoap.org/wsdl/";
+       xmlns:tns="http://soapinterop.org/wsdl";
+       xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
+       xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+       xmlns:ns2="http://soapinterop.org/types";
+       xmlns:ns3="http://soapinterop.org/types/part";
+       xmlns:ns4="http://soapinterop.org/types/requestresponse";
+       targetNamespace="http://soapinterop.org/wsdl";>
+
+       <types>
+               <schema
+                       xmlns="http://www.w3.org/2001/XMLSchema";
+                       xmlns:tns="http://soapinterop.org/types";
+                       targetNamespace="http://soapinterop.org/types";>
+
+                       <import 
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
+
+                       <complexType name="SOAPStruct">
+                               <sequence>
+                                       <element name="varString" 
type="xsd:string"/>
+                                       <element name="varInt" type="xsd:int"/>
+                                       <element name="varFloat" 
type="xsd:float"/>
+                               </sequence>
+                       </complexType>
+
+                       <complexType name="SOAPStructFault">
+                               <sequence>
+                                       <element name="soapStruct" 
type="tns:SOAPStruct"/>
+                               </sequence>
+                       </complexType>
+
+                       <complexType name="BaseStruct">
+                               <sequence>
+                                       <element name="structMessage" 
type="tns:SOAPStruct"/>
+                                       <element name="shortMessage" 
type="xsd:short"/>
+                               </sequence>
+                       </complexType>
+
+                       <complexType name="ExtendedStruct">
+                               <complexContent>
+                                       <extension base="tns:BaseStruct">
+                                               <sequence>
+                                                       <element 
name="stringMessage" type="xsd:string"/>
+                                                       <element 
name="intMessage" type="xsd:int"/>
+                                                       <element 
name="anotherIntMessage" type="xsd:int"/>
+                                               </sequence>
+                                       </extension>
+                               </complexContent>
+                       </complexType>
+
+                       <complexType name="MoreExtendedStruct">
+                               <complexContent>
+                                       <extension base="tns:ExtendedStruct">
+                                               <sequence>
+                                                       <element 
name="booleanMessage" type="xsd:boolean"/>
+                                               </sequence>
+                                       </extension>
+                               </complexContent>
+                       </complexType>
+
+               </schema>
+
+               <schema
+                       xmlns="http://www.w3.org/2001/XMLSchema";
+                       xmlns:tns="http://soapinterop.org/types/part";
+                       targetNamespace="http://soapinterop.org/types/part";>
+
+                       <element name="SOAPStructFaultPart" 
type="ns2:SOAPStructFault"/>
+                       <element name="BaseStructPart" type="ns2:BaseStruct"/>
+                       <element name="ExtendedStructPart" 
type="ns2:ExtendedStruct"/>
+                       <element name="MoreExtendedStructPart" 
type="ns2:MoreExtendedStruct"/>
+
+               </schema>
+
+               <schema
+                       xmlns="http://www.w3.org/2001/XMLSchema";
+                       xmlns:tns="http://soapinterop.org/types/requestresponse";
+                       
targetNamespace="http://soapinterop.org/types/requestresponse";>
+
+                       <element name="echoSOAPStructFaultRequest" 
type="ns2:SOAPStruct"/>
+                       <element name="echoSOAPStructFaultResponse">
+                               <complexType/>
+                       </element>
+
+                       <element name="echoBaseStructFaultRequest" 
type="ns2:BaseStruct"/>
+                       <element name="echoBaseStructFaultResponse">
+                               <complexType/>
+                       </element>
+
+                       <element name="echoExtendedStructFaultRequest" 
type="ns2:ExtendedStruct"/>
+                       <element name="echoExtendedStructFaultResponse">
+                               <complexType/>
+                       </element>
+
+                       <element name="echoMultipleFaults1Request">
+                               <complexType>
+                                       <sequence>
+                                               <element name="whichFault" 
type="xsd:int"/>
+                                               <element name="param1" 
type="ns2:SOAPStruct"/>
+                                               <element name="param2" 
type="ns2:BaseStruct"/>
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="echoMultipleFaults1Response">
+                               <complexType/>
+                       </element>
+
+                       <element name="echoMultipleFaults2Request">
+                               <complexType>
+                                       <sequence>
+                                               <element name="whichFault" 
type="xsd:int"/>
+                                               <element name="param1" 
type="ns2:BaseStruct"/>
+                                               <element name="param2" 
type="ns2:ExtendedStruct"/>
+                                               <element name="param3" 
type="ns2:MoreExtendedStruct"/>
+                                       </sequence>
+                               </complexType>
+                       </element>
+                       <element name="echoMultipleFaults2Response">
+                               <complexType/>
+                       </element>
+
+               </schema>
+       </types>
+
+    <!-- Some part references are  misspelled-->
+    <message name="echoSOAPStructFaultRequest">
+               <part name="param" element="ns4:echoSOAPStructFaultRequest1"/>
+       </message>
+       <message name="echoSOAPStructFaultResponse">
+               <part name="param" element="ns4:echoSOAPStructFaultResponse2"/>
+       </message>
+
+       <message name="echoBaseStructFaultRequest">
+               <part name="param" element="ns4:echoBaseStructFaultRequest1"/>
+       </message>
+       <message name="echoBaseStructFaultResponse">
+               <part name="param" element="ns4:echoBaseStructFaultResponse"/>
+       </message>
+
+       <message name="echoExtendedStructFaultRequest">
+               <part name="param" 
element="ns4:echoExtendedStructFaultRequest"/>
+       </message>
+       <message name="echoExtendedStructFaultResponse">
+               <part name="param" 
element="ns4:echoExtendedStructFaultResponse"/>
+       </message>
+
+       <message name="echoMultipleFaults1Request">
+               <part name="param" element="ns4:echoMultipleFaults1Request"/>
+       </message>
+       <message name="echoMultipleFaults1Response">
+               <part name="param" element="ns4:echoMultipleFaults1Response"/>
+       </message>
+
+       <message name="echoMultipleFaults2Request">
+               <part name="param" element="ns4:echoMultipleFaults2Request"/>
+       </message>
+       <message name="echoMultipleFaults2Response">
+               <part name="param" element="ns4:echoMultipleFaults2Response"/>
+       </message>
+
+       <!-- Fault messages -->
+       <message name="SOAPStructFault">
+               <part name="part3" element="ns3:SOAPStructFaultPart"/>
+       </message>
+       <message name="BaseStructFault">
+               <part name="part1" element="ns3:BaseStructPart"/>
+       </message>
+       <message name="ExtendedStructFault">
+               <part name="part2" element="ns3:ExtendedStructPart"/>
+       </message>
+       <message name="MoreExtendedStructFault">
+               <part name="part5" element="ns3:MoreExtendedStructPart"/>
+       </message>
+
+       <portType name="ComplexDocLitPortType">
+               <!--
+                       Throws a fault with an embedded SOAPStruct
+               -->
+               <operation name="echoSOAPStructFault" parameterOrder="">
+                       <input message="tns:echoSOAPStructFaultRequest"/>
+                       <output message="tns:echoSOAPStructFaultResponse"/>
+                       <fault name="ComplexFault" 
message="tns:SOAPStructFault"/>
+               </operation>
+
+               <!--
+                       Throws a fault with a base complex struct
+               -->
+               <operation name="echoBaseStructFault" parameterOrder="">
+                       <input message="tns:echoBaseStructFaultRequest"/>
+                       <output message="tns:echoBaseStructFaultResponse"/>
+                       <fault name="ComplexFault" 
message="tns:BaseStructFault"/>
+               </operation>
+
+               <!--
+                       Throws a fault with an en extended complex type
+               -->
+               <operation name="echoExtendedStructFault" parameterOrder="">
+                       <input message="tns:echoExtendedStructFaultRequest"/>
+                       <output message="tns:echoExtendedStructFaultResponse"/>
+                       <fault name="ComplexFault" 
message="tns:ExtendedStructFault"/>
+               </operation>
+
+               <!--
+                       Throws a fault with embedded complex type, fault with an
+                       extended complex type and fault with an array of a base
+                       complex type
+               -->
+               <operation name="echoMultipleFaults1" parameterOrder="param">
+                       <input message="tns:echoMultipleFaults1Request"/>
+                       <output message="tns:echoMultipleFaults1Response"/>
+                       <fault name="ComplexFault1" 
message="tns:SOAPStructFault"/>
+                       <fault name="ComplexFault2" 
message="tns:BaseStructFault"/>
+               </operation>
+
+               <!--
+                       Throws a fault with an array of base complex type and
+                       a fault with doubly extended complex type
+               -->
+               <operation name="echoMultipleFaults2" parameterOrder="param">
+                       <input message="tns:echoMultipleFaults2Request"/>
+                       <output message="tns:echoMultipleFaults2Response"/>
+                       <fault name="ComplexFault1" 
message="tns:BaseStructFault"/>
+                       <fault name="ComplexFault2" 
message="tns:ExtendedStructFault"/>
+                       <fault name="ComplexFault3" 
message="tns:MoreExtendedStructFault"/>
+               </operation>
+       </portType>
+
+       <binding name="ComplexDocLitBinding" type="tns:ComplexDocLitPortType">
+               <soap:binding transport="http://schemas.xmlsoap.org/soap/http"; 
style="document"/>
+               <operation name="echoSOAPStructFault">
+                       <input>
+                               <soap:body use="literal"/>
+                       </input>
+                       <output>
+                               <soap:body use="literal"/>
+                       </output>
+                       <fault name="ComplexFault">
+                               <soap:fault
+                                       name="ComplexFault"
+                                       use="literal"/>
+                       </fault>
+                       <soap:operation soapAction=""/>
+               </operation>
+
+               <operation name="echoBaseStructFault">
+                       <input>
+                               <soap:body use="literal"/>
+                       </input>
+                       <output>
+                               <soap:body use="literal"/>
+                       </output>
+                       <fault name="ComplexFault">
+                               <soap:fault
+                                       name="ComplexFault"
+                                       use="literal"/>
+                       </fault>
+                       <soap:operation soapAction=""/>
+               </operation>
+
+               <operation name="echoExtendedStructFault">
+                       <input>
+                               <soap:body use="literal"/>
+                       </input>
+                       <output>
+                               <soap:body use="literal"/>
+                       </output>
+                       <fault name="ComplexFault">
+                               <soap:fault
+                                       name="ComplexFault"
+                                       use="literal"/>
+                       </fault>
+                       <soap:operation soapAction=""/>
+               </operation>
+
+               <operation name="echoMultipleFaults1">
+                       <input>
+                               <soap:body use="literal"/>
+                       </input>
+                       <output>
+                               <soap:body use="literal"/>
+                       </output>
+                       <fault name="ComplexFault1">
+                               <soap:fault 
+                                       name="ComplexFault1"
+                                       use="literal"/>
+                       </fault>
+                       <fault name="ComplexFault2">
+                               <soap:fault
+                                       name="ComplexFault2"
+                                       use="literal"/>
+                       </fault>
+                       <soap:operation soapAction=""/>
+               </operation>
+
+               <operation name="echoMultipleFaults2">
+                       <input>
+                               <soap:body use="literal"/>
+                       </input>
+                       <output>
+                               <soap:body use="literal"/>
+                       </output>
+                       <fault name="ComplexFault1">
+                               <soap:fault
+                                       name="ComplexFault1"
+                                       use="literal"/>
+                       </fault>
+                       <fault name="ComplexFault2">
+                               <soap:fault 
+                                       name="ComplexFault2"
+                                       use="literal"/>
+                       </fault>
+                       <fault name="ComplexFault3">
+                               <soap:fault 
+                                       name="ComplexFault3"
+                                       use="literal"/>
+                       </fault>
+                       <soap:operation soapAction=""/>
+               </operation>
+       </binding>
+
+       <service name="ComplexDocLitService">
+               <port name="ComplexDocLitPort" 
binding="tns:ComplexDocLitBinding">
+                       <soap:address
+                               
location="http://localhost:8080/axis/services/ComplexDocLitPort"/>
+               </port>
+       </service>
+</definitions>
+

Modified: 
webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
URL: 
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java?rev=423041&r1=423040&r2=423041&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/xmlbeans/test/org/apache/axis2/xmlbeans/WSDL2JavaTest.java
 Tue Jul 18 03:38:24 2006
@@ -184,6 +184,19 @@
         }
     }
 
+     /**
+     * Test for the mime doc
+     */
+    public void testCodeGenerationUnreferenced(){
+        String wsdlName = "unreferenced.wsdl";
+        try {
+            generateAndCompile(wsdlName, 
OUTPUT_LOCATION_BASE+OUTPUT_LOCATION_PREFIX+folderCount++);
+            fail("Code generation should fail with  "+ wsdlName);
+        } catch (CodeGenerationException e) {
+
+        }
+    }
+
 //     /**
 //     * Test for the dime doc
 //     */
@@ -224,7 +237,7 @@
     /**
      * Test for the modified ping-unboond wsdl.
      * The binding is removed in this wsdl.Codegen should fail for this
-     * WSDL by saying
+     * WSDL by saying  no binding!
      *
      */
     public void testCodeGenerationPingUnbound(){



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to