axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r392263 [1/2] - in /webservices/axis2/trunk/java/modules: adb/src/org/apache/axis2/databinding/utils/ codegen/src/org/apache/axis2/util/ codegen/src/org/apache/axis2/wsdl/codegen/ codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/s...
Date Fri, 07 Apr 2006 12:38:47 GMT
Author: ajith
Date: Fri Apr  7 05:38:41 2006
New Revision: 392263

URL: http://svn.apache.org/viewcvs?rev=392263&view=rev
Log:
Removing WOM from codegeneration
1. Removed the WOM dependancy from Codegen configuration
2. Rewrote the extensions to completely run on the AxisService
3. Made minor changes to the perf tests to cater for the changes in the service name
4. Fixed the relative schema loading problem

Todo - some WSDL's are commented from the test cases (salesRanknPrice.wsdl)

Removed:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/AxisBindingBuilder.java
Modified:
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/PolicyAttachmentUtil.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/JavaEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JaxMeExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JiBXExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SchemaUnwrapperExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/wsdl/WSDL2JavaTest.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/integration/maven.xml
    webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeSkeleton.java
    webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/PerfPortTypeTest.java
    webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf/perf.wsdl
    webservices/axis2/trunk/java/modules/integration/test/samples/wsdl/perf2/perf.wsdl
    webservices/axis2/trunk/java/modules/security/interop/ping.wsdl
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLService.java

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java (original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/Constants.java Fri Apr  7 05:38:41 2006
@@ -2,6 +2,7 @@
 
 import org.apache.axis2.databinding.utils.reader.OMAttribKey;
 import org.apache.axis2.databinding.utils.reader.OMElementKey;
+import org.apache.axiom.om.OMConstants;
 
 /*
  * Copyright 2004,2005 The Apache Software Foundation.
@@ -28,7 +29,7 @@
     static Object OM_ATTRIBUTE_KEY = new OMAttribKey();
     static Object OM_ELEMENT_KEY = new OMElementKey();
 
-    static final String IS_BINARY = "Axiom.IsBinary";
-    static final String DATA_HANDLER = "Axiom.DataHandler";
-    static final String OPTIMIZATION_ENABLED = "Axiom.opt.enabled";
+    static final String IS_BINARY = OMConstants.IS_BINARY;
+    static final String DATA_HANDLER = OMConstants.DATA_HANDLER;
+    static final String OPTIMIZATION_ENABLED = OMConstants.IS_DATA_HANDLERS_AWARE;
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/PolicyAttachmentUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/PolicyAttachmentUtil.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/PolicyAttachmentUtil.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/PolicyAttachmentUtil.java Fri Apr  7 05:38:41 2006
@@ -66,8 +66,6 @@
 public class PolicyAttachmentUtil {
 
     private WSDLDescription wsdlDescription = null;
-
-    //private HashMap loadedPolicies = new HashMap();
     private PolicyRegistry reg = new PolicyRegistry();
 
     private SchemaRegistry schemaRegistry = new SchemaRegistry();

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenConfiguration.java Fri Apr  7 05:38:41 2006
@@ -32,10 +32,8 @@
 
     private AxisService axisService;
 
-    private WSDLDescription wom;
-
     private String baseURI;
-    
+
     private String repositoryPath;
 
     /**
@@ -69,9 +67,6 @@
         this.configurationProperties = configurationProperties;
     }
 
-    public void setWom(WSDLDescription wom) {
-        this.wom = wom;
-    }
 
     public void setOutputLanguage(String outputLanguage) {
         this.outputLanguage = outputLanguage;
@@ -206,13 +201,6 @@
         this.policyMap = policyMap;
     }
 
-    /* Code generation style means whether to use the binding or the interface for code generation.
-    * the default is automatic where the code generator looks for the binding and if the binding is
-    * absent, switches to the interface. The user however, can switch to the interface or the binding
-    * modes explicitly by specifying this parameter
-    */
-    private int codeGenerationStyle = XSLTConstants.CodegenStyle.AUTOMATIC;
-
 
     /**
      * Puts a property into the configuration.
@@ -245,19 +233,6 @@
 
     private TypeMapper typeMapper;
 
-    /**
-     * @return Returns int.
-     */
-    public int getCodeGenerationStyle() {
-        return codeGenerationStyle;
-    }
-
-    /**
-     * @param codeGenerationStyle
-     */
-    public void setCodeGenerationStyle(int codeGenerationStyle) {
-        this.codeGenerationStyle = codeGenerationStyle;
-    }
 
     /**
      * @return Returns TypeMapper.
@@ -294,20 +269,23 @@
      * @param wom
      * @param optionMap
      */
-    public CodeGenConfiguration(WSDLDescription wom, Map optionMap) {
-        this.wom = wom;
+    public CodeGenConfiguration(AxisService service, Map optionMap) {
+        this.axisService = service;
         CodegenConfigLoader.loadConfig(this,optionMap);
     }
 
-
     /**
-     * @return Returns the wom.
+     * Constructor for the configuration. It populates the values using the options map.
+     *
+     * @param wom
+     * @param optionMap
      */
-    public WSDLDescription getWom() {
-        return wom;
+    public CodeGenConfiguration(Map optionMap) {
+        CodegenConfigLoader.loadConfig(this,optionMap);
     }
 
 
+
     /**
      * @return Returns the outputLocation.
      */
@@ -368,13 +346,13 @@
     public void setWriteMessageReceiver(boolean writeMessageReceiver) {
         this.writeMessageReceiver = writeMessageReceiver;
     }
-    
+
     public void setRepositoryPath(String repositoryPath) {
-    	this.repositoryPath = repositoryPath;    	
+        this.repositoryPath = repositoryPath;
     }
-    
+
     public String getRepositoryPath() {
-    	return repositoryPath;    	
+        return repositoryPath;
     }
 
     public AxisService getAxisService() {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/CodeGenerationEngine.java Fri Apr  7 05:38:41 2006
@@ -17,8 +17,8 @@
 package org.apache.axis2.wsdl.codegen;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.util.XMLUtils;
 import org.apache.axis2.description.WSDL2AxisServiceBuilder;
-import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
 import org.apache.axis2.wsdl.codegen.emitter.Emitter;
 import org.apache.axis2.wsdl.codegen.extension.CodeGenExtension;
 import org.apache.axis2.wsdl.databinding.TypeMapper;
@@ -29,12 +29,17 @@
 import org.apache.axis2.wsdl.util.ConfigPropertyFileLoader;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.wsdl.WSDLDescription;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
 
 import javax.wsdl.WSDLException;
+import javax.wsdl.Definition;
+import javax.wsdl.factory.WSDLFactory;
+import javax.wsdl.xml.WSDLReader;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.namespace.QName;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.List;
@@ -64,34 +69,46 @@
      * @throws CodeGenerationException
      */
     public CodeGenerationEngine(CommandLineOptionParser parser) throws CodeGenerationException {
-        WSDLDescription wom;
         Map allOptions = parser.getAllOptions();
         String wsdlUri;
         try {
 
-            CommandLineOption option = (CommandLineOption)allOptions.get(CommandLineOptionConstants.WSDL2JavaConstants.WSDL_LOCATION_URI_OPTION);
+            CommandLineOption option =
+                    (CommandLineOption)allOptions.
+                            get(CommandLineOptionConstants.WSDL2JavaConstants.WSDL_LOCATION_URI_OPTION);
             wsdlUri = option.getOptionValue();
-            wom = this.getWOM(wsdlUri);
-        } catch (WSDLException e) {
-            throw new CodeGenerationException(CodegenMessages.getMessage("engine.wsdlParsingException"), e);
-        }
-
-        configuration = new CodeGenConfiguration(wom, allOptions);
+            configuration = new CodeGenConfiguration(allOptions);
+            Definition wsdl4jDef = readInTheWSDLFile(wsdlUri);
+            QName serviceQname = null;
+            if (configuration.getServiceName()!=null){
+                serviceQname = new QName(wsdl4jDef.getTargetNamespace(), configuration.getServiceName());
+            }
 
-        /////////////////////////////////////////////////////////////////
-        try {
-            configuration.setAxisService(new WSDL2AxisServiceBuilder(new FileInputStream(wsdlUri)).populateService());
+            configuration.setAxisService(new WSDL2AxisServiceBuilder(
+                    wsdl4jDef,
+                    serviceQname,
+                    configuration.getPortName()).
+                    populateService()
+            );
         } catch (AxisFault axisFault) {
-            axisFault.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        } catch (FileNotFoundException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            throw new CodeGenerationException(CodegenMessages.getMessage("engine.wsdlParsingException"), axisFault);
+        } catch (WSDLException e) {
+            throw new CodeGenerationException(CodegenMessages.getMessage("engine.wsdlParsingException"), e);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new CodeGenerationException(CodegenMessages.getMessage("engine.wsdlParsingException"), e);
         }
         ///////////////////////////////////////////////////////////////////////
-        
+
         configuration.setBaseURI(getBaseURI(wsdlUri));
         loadExtensions();
     }
 
+    /**
+     * Loads the relevant extensions
+     *
+     * @throws CodeGenerationException
+     */
     private void loadExtensions() throws CodeGenerationException {
 
         String[] extensions = ConfigPropertyFileLoader.getExtensionClassNames();
@@ -102,6 +119,10 @@
 
     }
 
+    /**
+     * Adds a given extension to the list
+     * @param ext
+     */
     private void addExtension(CodeGenExtension ext) {
         if(ext != null) {
             ext.init(configuration);
@@ -109,7 +130,10 @@
         }
     }
 
-
+    /**
+     * Generate a WSDL
+     * @throws CodeGenerationException
+     */
     public void generate() throws CodeGenerationException {
         try {
             for (int i = 0; i < extensions.size(); i++) {
@@ -142,7 +166,7 @@
 
             if (configuration.isServerSide()) {
                 emitter.emitSkeleton();
-                //if the users want both client and server, it would be in the 
+                // if the users want both client and server, it would be in the
                 // generate all option
 
                 if (configuration.isGenerateAll()) {
@@ -166,19 +190,49 @@
 
 
     /**
-     *
+     * Read the WSDL file
      * @param uri
      * @return
      * @throws WSDLException
      */
-    private WSDLDescription getWOM(String uri) throws WSDLException {
-        //assume that the builder is always WSDL 1.1 - later we'll have to edit this to allow
-        //WSDL version to be passed
-        return WOMBuilderFactory.getBuilder(org.apache.wsdl.WSDLConstants.WSDL_1_1).build(uri)
-                .getDescription();
+    private Definition readInTheWSDLFile(String uri) throws WSDLException {
+
+        WSDLReader reader =
+                WSDLFactory.newInstance().newWSDLReader();
+        reader.setFeature("javax.wsdl.importDocuments", true);
+
+        File file = new File(uri);
+        String baseURI;
+
+        if (uri.startsWith("http://")){
+            baseURI = uri;
+        } else{
+            baseURI = file.getParentFile()!=null?file.getParentFile().toURI().toString():null;
+        }
+
+
+        Document doc;
+        try {
+            doc = XMLUtils.newDocument(uri);
+        } catch (ParserConfigurationException e) {
+            throw new WSDLException(WSDLException.PARSER_ERROR,
+                    "Parser Configuration Error",
+                    e);
+        } catch (SAXException e) {
+            throw new WSDLException(WSDLException.PARSER_ERROR,
+                    "Parser SAX Error",
+                    e);
+
+        } catch (IOException e) {
+            throw new WSDLException(WSDLException.INVALID_WSDL, "IO Error", e);
+        }
+
+        return reader.readWSDL(baseURI, doc);
     }
 
 
+
+
     /**
      * gets a object from the class
      *
@@ -221,8 +275,8 @@
                 throw new RuntimeException("Cannot find baseuri for :" + currentURI);
             }
         }
-        String uriFrag = currentURI.substring(0, currentURI.lastIndexOf("/"));
-        baseURI = uriFrag + (uriFrag.endsWith("/") ? "" : "/");
+        String uriFragment = currentURI.substring(0, currentURI.lastIndexOf("/"));
+        baseURI = uriFragment + (uriFragment.endsWith("/") ? "" : "/");
         return baseURI;
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/codegen-config.properties Fri Apr  7 05:38:41 2006
@@ -5,7 +5,7 @@
 # these are loaded in their lexical order
 # Note the last extension - It includes a check to figure out whether proper databinding has taken place
 # This extension should appear AFTER all the databinding extensions inorder to function properly
-codegen.extension=org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension,org.apache.axis2.wsdl.codegen.extension.PackageFinder,org.apache.axis2.wsdl.codegen.extension.JaxMeExtension,org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension,org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension,org.apache.axis2.wsdl.codegen.extension.JiBXExtension,org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension,org.apache.axis2.wsdl.codegen.extension.PolicyEvaluator
+codegen.extension=org.apache.axis2.wsdl.codegen.extension.JaxMeExtension,org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension,org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension,org.apache.axis2.wsdl.codegen.extension.JiBXExtension,org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension
 #codegen.extension=org.apache.axis2.wsdl.codegen.extension.AxisBindingBuilder,org.apache.axis2.wsdl.codegen.extension.WSDLValidatorExtension,org.apache.axis2.wsdl.codegen.extension.PackageFinder,org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension
 # The third party schemas to be loaded. e.g. The Xmime extension
 # Note - these will be loaded from the org.apache.axis2.wsdl.codegen.schema package.
@@ -39,7 +39,7 @@
 # The emiiters need to implement the org.apache.axis2.wsdl.codegen.emitter.Emitter interface
 # Note - The emitters should appear in the lexical order of the languages. So the language java in the above
 # list corresponds to the org.apache.axis2.wsdl.codegen.emitter.JavaEmitter
-codegen.emitters=org.apache.axis2.wsdl.codegen.emitter.JavaEmitter,org.apache.axis2.wsdl.codegen.emitter.CSharpEmitter
+codegen.emitters=org.apache.axis2.wsdl.codegen.emitter.AxisServiceBasedMultiLanguageEmitter,org.apache.axis2.wsdl.codegen.emitter.CSharpEmitter
 # Default language, this is the default language that would be picked when no language is specified. it should be
 # one of the languages specified above
 codegen.languages.default=java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Fri Apr  7 05:38:41 2006
@@ -20,6 +20,7 @@
 import org.apache.ws.policy.Policy;
 import org.apache.wsdl.WSDLConstants;
 import org.apache.wsdl.WSDLExtensibilityAttribute;
+import org.apache.wsdl.extensions.SOAPHeader;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -931,7 +932,11 @@
 
                 addAttribute(doc, "name", localPart, methodElement);
                 addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(), methodElement);
-                addAttribute(doc, "style", axisOperation.getStyle(), methodElement);
+                String style = axisOperation.getStyle();
+
+                System.out.println("##############" + style);
+
+                addAttribute(doc, "style", style, methodElement);
                 addAttribute(doc, "dbsupportname", portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                         methodElement);
 
@@ -1107,31 +1112,49 @@
         addAttribute(doc, "soapaction", axisOperation.getSoapAction(), rootElement);
     }
 
+    /**
+     * populate the header parameters
+     * @param soapHeaderParameterQNameList
+     * @param axisOperation
+     * @param input
+     */
     private void addHeaderOperations(List soapHeaderParameterQNameList, AxisOperation axisOperation,
                                      boolean input) {
-//        Iterator extIterator;
-//
-//        if (input) {
-//            extIterator = (axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE) == null)
-//                    ? null
-//                    : axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getWsdlExtElements().iterator();
-//        } else {
-//            extIterator = (axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE) == null)
-//                    ? null
-//                    : axisOperation.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE).getWsdlExtElements().iterator();
-//        }
-//
-//        while ((extIterator != null) && extIterator.hasNext()) {
-//            AxisExtensiblityElementWrapper axisExtensibilityElement = (AxisExtensiblityElementWrapper) extIterator.next();
-//
-//            WSDLExtensibilityElement element = axisExtensibilityElement.getExtensibilityElement();
-//
-//            if (ExtensionConstants.SOAP_11_HEADER.equals(element.getType())) {
-//                SOAPHeader header = (SOAPHeader) element;
-//
-//                soapHeaderParameterQNameList.add(header.getElement());
-//            }
-//        }
+        ArrayList headerparamList = new ArrayList();
+        String MEP = axisOperation.getMessageExchangePattern();
+        if (input){
+            if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+                AxisMessage inaxisMessage = axisOperation
+                        .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+                if (inaxisMessage != null) {
+                    headerparamList = inaxisMessage.getSoapHeaders();
+
+                }
+            }
+        }else{
+            if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+                AxisMessage outAxisMessage = axisOperation
+                        .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+                if (outAxisMessage != null) {
+                    headerparamList = outAxisMessage.getSoapHeaders();
+                }
+            }
+        }
+
+        for (Iterator iterator = headerparamList.iterator(); iterator.hasNext();) {
+            SOAPHeader header = (SOAPHeader) iterator.next();
+            soapHeaderParameterQNameList.add(header.getElement());
+        }
     }
 
     protected Element getInputElement(Document doc, AxisOperation operation, List headerParameterQNameList) {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CSharpEmitter.java Fri Apr  7 05:38:41 2006
@@ -20,20 +20,20 @@
 import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
 import org.apache.axis2.wsdl.databinding.TypeMapper;
 
-public class CSharpEmitter extends MultiLanguageClientEmitter {
+public class CSharpEmitter extends AxisServiceBasedMultiLanguageEmitter {
 
     public CSharpEmitter() {
     }
 
     public CSharpEmitter(CodeGenConfiguration configuration) {
-        this.configuration = configuration;
+        this.codeGenConfiguration = configuration;
         this.mapper = new DefaultTypeMapper();
 
     }
 
     public CSharpEmitter(CodeGenConfiguration configuration,
                          TypeMapper mapper) {
-        this.configuration = configuration;
+        this.codeGenConfiguration = configuration;
         this.mapper = mapper;
 
     }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/JavaEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/JavaEmitter.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/JavaEmitter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/JavaEmitter.java Fri Apr  7 05:38:41 2006
@@ -20,7 +20,7 @@
 import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
 import org.apache.axis2.wsdl.databinding.TypeMapper;
 
-public class JavaEmitter extends MultiLanguageClientEmitter {
+public class JavaEmitter extends AxisServiceBasedMultiLanguageEmitter {
 
     public JavaEmitter() {
         super();
@@ -31,7 +31,7 @@
      */
     public JavaEmitter(CodeGenConfiguration configuration) {
         super();
-        this.configuration = configuration;
+        this.codeGenConfiguration = configuration;
         this.mapper = new DefaultTypeMapper();
 
 
@@ -45,7 +45,7 @@
      */
     public JavaEmitter(CodeGenConfiguration configuration, TypeMapper mapper) {
         super();
-        this.configuration = configuration;
+        this.codeGenConfiguration = configuration;
         this.mapper = mapper;
 
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JaxMeExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JaxMeExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JaxMeExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JaxMeExtension.java Fri Apr  7 05:38:41 2006
@@ -29,6 +29,7 @@
 import org.apache.ws.jaxme.generator.sg.impl.JAXBSchemaReader;
 import org.apache.ws.jaxme.js.JavaQName;
 import org.apache.ws.jaxme.xs.xml.XsQName;
+import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.wsdl.WSDLBinding;
 import org.apache.wsdl.WSDLBindingMessageReference;
 import org.apache.wsdl.WSDLBindingOperation;
@@ -52,6 +53,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
+import java.io.ByteArrayOutputStream;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -74,7 +76,7 @@
     public static final String SCHEMA_PATH = "/org/apache/axis2/wsdl/codegen/schema/";
 
     boolean debug = false;
-    
+
     public void engage() {
 
         //test the databinding type. If not just fall through
@@ -82,15 +84,12 @@
             return;
         }
 
-        //check the comptibilty
-        checkCompatibility();
-
         try {
             //get the types from the types section
-            WSDLTypes typesList = configuration.getWom().getTypes();
+            List typesList = configuration.getAxisService().getSchema();
 
             //check for the imported types. Any imported types are supposed to be here also
-            if (typesList == null) {
+            if (typesList == null || typesList.isEmpty()) {
                 //there are no types to be code generated
                 //However if the type mapper is left empty it will be a problem for the other
                 //processes. Hence the default type mapper is set to the configuration
@@ -98,57 +97,16 @@
                 return;
             }
 
-            List typesArray = typesList.getExtensibilityElements();
-            //this a list that keeps the already processed schemas
-            List processedSchemas = new ArrayList();
-
-            WSDLExtensibilityElement extensiblityElt;
 
             Vector xmlObjectsVector = new Vector();
             //create the type mapper
             JavaTypeMapper mapper = new JavaTypeMapper();
 
-            for (int i = 0; i < typesArray.size(); i++) {
-                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
-                Schema schema;
-
-                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
-                    schema = (Schema) extensiblityElt;
-
-//                    TODO: FIXME                    
-//                    Map namespaceMap = configuration.getWom().getNamespaces();
-//                    if (namespaceMap != null && !namespaceMap.isEmpty()) {
-//                        Iterator nameSpaces = namespaceMap.keySet().iterator();
-//                        String nsPrefix;
-//                        String nsURI;
-//                        while (nameSpaces.hasNext()) {
-//                            nsPrefix = (String) nameSpaces.next();
-//                            nsURI = namespaceMap.get(nsPrefix).toString();
-//                            parser.addImport(nsURI, null);
-//                        }
-//                    }
-
-                    Stack importedSchemaStack = schema.getImportedSchemaStack();
-                    File schemaFolder = null;
-                    if(debug) {
-                        schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
-                        schemaFolder.mkdir();
-                    }
-                    //compile these schemas
-                    while (!importedSchemaStack.isEmpty()) {
-                        Element element = (Element) importedSchemaStack.pop();
-                        String tagetNamespace = element.getAttribute("targetNamespace");
-                        if (!processedSchemas.contains(tagetNamespace)) {
-
-                            String s = DOM2Writer.nodeToString(element);
-                            xmlObjectsVector.add(new InputSource(new StringReader(s)));
-                            processedSchemas.add(tagetNamespace);
-                        }
-                    }
-                }
+            for (int i = 0; i < typesList.size(); i++) {
+                XmlSchema schema = (XmlSchema)typesList.get(i);
+                xmlObjectsVector.add(new InputSource(new StringReader(getSchemaAsString(schema))));
             }
 
-
 //            TODO: FIXME            
 //            Element[] additionalSchemas = loadAdditionalSchemas();
 //            // Need to add the third party schemas
@@ -173,45 +131,31 @@
                 for(int j=0;j<elements.length;j++){
                     XsQName qName = elements[j].getName();
                     JavaQName name = elements[j].getClassContext().getXMLInterfaceName();
-                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()), 
-                                            name.getPackageName() + '.' + name.getClassName());
+                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()),
+                            name.getPackageName() + '.' + name.getClassName());
                 }
                 TypeSG[] types = sg.getTypes();
                 for(int j=0;j<types.length;j++){
                     XsQName qName = types[j].getName();
                     JavaQName name = types[j].getRuntimeType();
-                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()), 
-                                            name.getPackageName() + '.' + name.getClassName());
+                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()),
+                            name.getPackageName() + '.' + name.getClassName());
                 }
                 GroupSG[] groups = sg.getGroups();
                 for(int j=0;j<groups.length;j++){
                     XsQName qName = groups[j].getName();
                     JavaQName name = groups[j].getClassContext().getXMLInterfaceName();
-                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()), 
-                                            name.getPackageName() + '.' + name.getClassName());
+                    mapper.addTypeMappingName(new QName(qName.getNamespaceURI(), qName.getLocalName()),
+                            name.getPackageName() + '.' + name.getClassName());
                 }
             }
 
-//            TODO: FIXME                    
-//            // prune the generated schema type system and add the list of base64 types
-//            FindBase64Types(sts);
-//
-//            //get the schematypes and add the document types to the type mapper
-//            SchemaType[] schemaType = sts.documentTypes();
-//            SchemaType type;
-//            for (int j = 0; j < schemaType.length; j++) {
-//                type = schemaType[j];
-//                mapper.addTypeMappingName(type.getDocumentElementName(),
-//                        type.getFullJavaName());
-//            }
+
 
             //set the type mapper to the config
             configuration.setTypeMapper(mapper);
 
-            if(debug) {
-                // write the mapper to a file for later retriival
-                writeMappingsToFile(mapper.getAllMappedNames());
-            }
+
 
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -219,70 +163,7 @@
 
     }
 
-    private void writeMappingsToFile(Map typeMappings) throws IOException {
-
-        File typeMappingFolder = new File(configuration.getOutputLocation(), MAPPING_FOLDER);
-        if (!typeMappingFolder.exists()) {
-            typeMappingFolder.mkdir();
-        }
-
-        File typeMappingFile = File.createTempFile(MAPPER_FILE_NAME, ".xml", typeMappingFolder);
-        BufferedWriter out = new BufferedWriter(new FileWriter(typeMappingFile));
-        out.write("<" + MAPPINGS + ">");
-
-        Iterator iterator = typeMappings.keySet().iterator();
-        while (iterator.hasNext()) {
-            QName qName = (QName) iterator.next();
-            String fullJavaName = (String) typeMappings.get(qName);
-            out.write("<" + MAPPING + ">");
-            out.write("<" + MESSAGE + ">" + qName.getLocalPart() + "</" + MESSAGE + ">");
-            out.write("<" + JAVA_NAME + ">" + fullJavaName + "</" + JAVA_NAME + ">");
-            out.write("</" + MAPPING + ">");
-        }
-        out.write("</" + MAPPINGS + ">");
-        out.close();
-
-    }
 
-//   TODO: FIXME    
-//    /**
-//     * Populate the base64 types
-//     * The algo is to look for simpletypes that have base64 content, and then step out of that
-//     * onestep and get the element. For now there's an extended check to see whether the simple type
-//     * is related to the Xmime:contentType!
-//     *
-//     * @param sts
-//     */
-//    private void FindBase64Types(SchemaTypeSystem sts) {
-//        List allSeenTypes = new ArrayList();
-//        List base64ElementQNamesList = new ArrayList();
-//        SchemaType outerType;
-//        //add the document types and global types
-//        allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
-//        allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
-//        for (int i = 0; i < allSeenTypes.size(); i++) {
-//            SchemaType sType = (SchemaType) allSeenTypes.get(i);
-//
-//            if (sType.getContentType() == SchemaType.SIMPLE_CONTENT && sType.getPrimitiveType() != null) {
-//                if (XSLTConstants.BASE_64_CONTENT_QNAME.equals(sType.getPrimitiveType().getName())) {
-//                    outerType = sType.getOuterType();
-//                    //check the outer type further to see whether it has the contenttype attribute from
-//                    //XMime namespace
-//                    SchemaProperty[] properties = sType.getProperties();
-//                    for (int j = 0; j < properties.length; j++) {
-//                        if (XSLTConstants.XMIME_CONTENT_TYPE_QNAME.equals(properties[j].getName())) {
-//                            base64ElementQNamesList.add(outerType.getDocumentElementName());
-//                            break;
-//                        }
-//                    }
-//                }
-//            }
-//            //add any of the child types if there are any
-//            allSeenTypes.addAll(Arrays.asList(sType.getAnonymousTypes()));
-//        }
-//
-//        configuration.putProperty(XSLTConstants.BASE_64_PROPERTY_KEY, base64ElementQNamesList);
-//    }
 
     /**
      * Loading the external schemas.
@@ -326,42 +207,12 @@
     }
 
 
-    /**
-     * Checking the compatibilty has to do with generating RPC/encoded stubs.
-     * If the XMLBeans bindings are used encoded binding cannot be done.
-     */
-    private void checkCompatibility() {
-        Map bindingMap = this.configuration.getWom().getBindings();
-        Collection col = bindingMap.values();
-
-        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-            WSDLBinding b = (WSDLBinding) iterator.next();
-            HashMap bindingOps = b.getBindingOperations();
-            Collection bindingOpsCollection = bindingOps.values();
-            for (Iterator iterator1 = bindingOpsCollection.iterator(); iterator1.hasNext();) {
-                foo((WSDLBindingOperation) iterator1.next());
-            }
 
-        }
-    }
 
-    protected void foo(WSDLBindingOperation bindingOp) {
-        WSDLBindingMessageReference input = bindingOp.getInput();
-        if (input != null) {
-            Iterator extIterator = input.getExtensibilityElements()
-                    .iterator();
-            while (extIterator.hasNext()) {
-                WSDLExtensibilityElement element = (WSDLExtensibilityElement) extIterator.next();
-                if (ExtensionConstants.SOAP_11_BODY.equals(element.getType()) ||
-                        ExtensionConstants.SOAP_12_BODY.equals(element.getType())) {
-                    if (WSDLConstants.WSDL_USE_ENCODED.equals(
-                            ((SOAPBody) element).getUse())) {
-                        throw new RuntimeException(
-                                CodegenMessages.getMessage("extension.encodedNotSupported"));
-                    }
-                }
-            }
-        }
+    private String getSchemaAsString(XmlSchema schema){
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        schema.write(baos);
+        return baos.toString();
     }
 }
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JiBXExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JiBXExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JiBXExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/JiBXExtension.java Fri Apr  7 05:38:41 2006
@@ -17,35 +17,32 @@
 package org.apache.axis2.wsdl.codegen.extension;
 
 import java.lang.reflect.Method;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
 import org.apache.axis2.wsdl.i18n.CodegenMessages;
-import org.apache.wsdl.WSDLBinding;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisMessage;
 import org.apache.wsdl.WSDLBindingMessageReference;
 import org.apache.wsdl.WSDLBindingOperation;
 import org.apache.wsdl.WSDLConstants;
 import org.apache.wsdl.WSDLExtensibilityElement;
-import org.apache.wsdl.WSDLInterface;
-import org.apache.wsdl.WSDLOperation;
 import org.apache.wsdl.extensions.ExtensionConstants;
 import org.apache.wsdl.extensions.SOAPBody;
 
 public class JiBXExtension extends AbstractDBProcessingExtension {
-    
+
     public static final String BINDING_PATH_OPTION = "bindingfile";
     public static final String JIBX_MODEL_CLASS =
-        "org.jibx.binding.model.BindingElement";
+            "org.jibx.binding.model.BindingElement";
     public static final String JIBX_UTILITY_CLASS =
-        "org.apache.axis2.jibx.CodeGenerationUtility";
+            "org.apache.axis2.jibx.CodeGenerationUtility";
     public static final String BINDING_MAP_METHOD = "getBindingMap";
-    
+
     public void engage() {
 
         // just return if JiBX binding not active
@@ -53,51 +50,43 @@
             return;
         }
 
-        // check the comptibilty - currently only doc/lit is supported
-        checkCompatibility();
-        
+
         // check the JiBX binding definition file specified
         String path = (String)configuration.getProperties().get(BINDING_PATH_OPTION);
         if (path == null) {
             throw new RuntimeException("jibx binding option requires -" +
-                BINDING_PATH_OPTION + " {file path} parameter");
-//                CodegenMessages.getMessage("extension.encodedNotSupported"));
+                    BINDING_PATH_OPTION + " {file path} parameter");
         }
         try {
-            
+
             // load and call JiBX utilities to handle binding
-            Class clas = null;
+            Class clazz = null;
             try {
                 JiBXExtension.class.getClassLoader().loadClass(JIBX_MODEL_CLASS);
             } catch (ClassNotFoundException e) {
                 throw new RuntimeException("JiBX framework jars not in classpath");
             }
             try {
-                clas = JiBXExtension.class.getClassLoader().loadClass(JIBX_UTILITY_CLASS);
+                clazz = JiBXExtension.class.getClassLoader().loadClass(JIBX_UTILITY_CLASS);
             } catch (ClassNotFoundException e) {
                 throw new RuntimeException("JiBX binding extension not in classpath");
             }
-            Method method = clas.getMethod(BINDING_MAP_METHOD,
-                new Class[] { String.class });
+            Method method = clazz.getMethod(BINDING_MAP_METHOD,
+                    new Class[] { String.class });
             HashMap jibxmap = (HashMap)method.invoke(null, new Object[] { path });
-            
+
             // Want to find all elements by working down from bindings (if any
             // supplied) or interfaces (if no bindings). Not sure why this dual
             // path is required, but based on the code in
             // org.apache.axis2.wsdl.builder.SchemaUnwrapper
             HashSet elements = new HashSet();
-            Map bindings = configuration.getWom().getBindings();
-            Map interfaces = configuration.getWom().getWsdlInterfaces();
-            if (bindings != null && !bindings.isEmpty()) {
-                for (Iterator iter = bindings.values().iterator(); iter.hasNext();) {
-                    accumulateElements(((WSDLBinding)iter.next()).getBoundInterface(), elements);
-                }
-            } else if (interfaces != null && !interfaces.isEmpty()) {
-                for (Iterator iter = interfaces.values().iterator(); iter.hasNext();) {
-                    accumulateElements((WSDLInterface)iter.next(), elements);
-                }
+            Iterator operations = configuration.getAxisService().getOperations();
+            while (operations.hasNext()) {
+                AxisOperation o =  (AxisOperation)operations.next();
+                accumulateElements(o, elements);
             }
-            
+
+
             // build type mapping from JiBX mappings for elements
             JavaTypeMapper mapper = new JavaTypeMapper();
             for (Iterator iter = elements.iterator(); iter.hasNext();) {
@@ -108,10 +97,10 @@
                 }
                 mapper.addTypeMappingName(qname, cname);
             }
-            
+
             // set the type mapper to the config
             configuration.setTypeMapper(mapper);
-            
+
         } catch (Exception e) {
             if (e instanceof RuntimeException) {
                 throw (RuntimeException)e;
@@ -126,41 +115,39 @@
      * Accumulate the QNames of all message elements used by an interface. Based on
      * the code in {@link org.apache.axis2.wsdl.builder.SchemaUnwrapper}
      * 
-     * @param interf
+     * @param op
      * @param elements
      */
-    private void accumulateElements(WSDLInterface interf, HashSet elements) {
-        
-        // we should be getting all the operation since we also need to consider the inherited ones
-        for (Iterator iter = interf.getAllOperations().values().iterator(); iter.hasNext();) {
-            WSDLOperation operation = (WSDLOperation)iter.next();
-            if (operation.getInputMessage() != null) {
-                elements.add(operation.getInputMessage().getElementQName());
-            }
-            if (operation.getOutputMessage() != null) {
-                elements.add(operation.getOutputMessage().getElementQName());
+    private void accumulateElements(AxisOperation op, HashSet elements) {
+        String MEP = op.getMessageExchangePattern();
+        if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            AxisMessage inaxisMessage = op
+                    .getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+            if (inaxisMessage != null) {
+                elements.add(inaxisMessage.getElementQName());
             }
         }
-    }
 
-    /**
-     * Checking the compatibilty has to do with generating RPC/encoded stubs.
-     * If the XMLBeans bindings are used encoded binding cannot be done.
-     */
-    private void checkCompatibility() {
-        Map bindingMap = this.configuration.getWom().getBindings();
-        Collection col = bindingMap.values();
-
-        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-            WSDLBinding b = (WSDLBinding) iterator.next();
-            HashMap bindingOps = b.getBindingOperations();
-            Collection bindingOpsCollection = bindingOps.values();
-            for (Iterator iterator1 = bindingOpsCollection.iterator(); iterator1.hasNext();) {
-                checkInvalidUse((WSDLBindingOperation) iterator1.next());
+        if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            AxisMessage outAxisMessage = op
+                    .getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
+            if (outAxisMessage != null) {
+                elements.add(outAxisMessage.getElementQName());
             }
-
         }
     }
+
+
 
     protected void checkInvalidUse(WSDLBindingOperation bindingOp) {
         WSDLBindingMessageReference input = bindingOp.getInput();

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PackageFinder.java Fri Apr  7 05:38:41 2006
@@ -25,16 +25,11 @@
     public void engage() {
         String packageName = this.configuration.getPackageName();
         if (packageName == null || URLProcessor.DEFAULT_PACKAGE.equals(packageName)) {
-            WSDLBinding binding = configuration.getWom().getBinding(
-                    AxisBindingBuilder.AXIS_BINDING_QNAME);
-            if (binding != null &&
-                    binding.getBoundInterface() != null &&
-                    binding.getBoundInterface().getName() != null &&
-                    binding.getBoundInterface().getName().getNamespaceURI() != null) {
-                String temp = binding.getBoundInterface().getName()
-                        .getNamespaceURI();
-                packageName = URLProcessor.makePackageName(temp);
-            }
+            //use the target namespace from the axis service to form a package
+            //name
+            packageName = URLProcessor.makePackageName(
+                    configuration.getAxisService().getTargetNamespace()
+            );
         }
 
         if (null == packageName || "".equals(packageName))

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SchemaUnwrapperExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SchemaUnwrapperExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SchemaUnwrapperExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SchemaUnwrapperExtension.java Fri Apr  7 05:38:41 2006
@@ -28,8 +28,8 @@
 
     public void engage() throws CodeGenerationException {
           if (!configuration.isParametersWrapped()){
-              //unwrap the schema since we are told to do so
-             SchemaUnwrapper.unwrap(configuration.getWom());
+//              //unwrap the schema since we are told to do so
+//             SchemaUnwrapper.unwrap(configuration.getWom());
           }
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/SimpleDBExtension.java Fri Apr  7 05:38:41 2006
@@ -22,21 +22,12 @@
 import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
 import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
 import org.apache.axis2.wsdl.util.XSLTConstants;
-import org.apache.ws.commons.schema.XmlSchema;
-import org.apache.ws.commons.schema.XmlSchemaCollection;
-import org.apache.wsdl.WSDLExtensibilityElement;
-import org.apache.wsdl.WSDLTypes;
-import org.apache.wsdl.extensions.ExtensionConstants;
-import org.apache.wsdl.extensions.Schema;
-import org.w3c.dom.Element;
 
 import javax.xml.namespace.QName;
 import java.io.File;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Stack;
-import java.util.Vector;
 
 /**
  * Extension for simple data binding.
@@ -53,8 +44,8 @@
         }
         try {
 
-            WSDLTypes typesList = configuration.getWom().getTypes();
-            if (typesList == null) {
+            List schemaList = configuration.getAxisService().getSchema();
+            if (schemaList == null || schemaList.isEmpty()) {
                 //there are no types to be code generated
                 //However if the type mapper is left empty it will be a problem for the other
                 //processes. Hence the default type mapper is set to the configuration
@@ -62,43 +53,6 @@
                 return;
             }
 
-            List typesArray = typesList.getExtensibilityElements();
-            WSDLExtensibilityElement extensiblityElt;
-            Vector xmlSchemaTypeVector = new Vector();
-            XmlSchemaCollection schemaColl = new XmlSchemaCollection();
-            //add the base uri
-            if (configuration.getBaseURI()!=null){
-                schemaColl.setBaseUri(configuration.getBaseURI());
-            }
-
-
-
-            for (int i = 0; i < typesArray.size(); i++) {
-                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
-
-                //add the namespace map here. it is absolutely needed
-                Map nsMap = configuration.getWom().getNamespaces();
-                Iterator keys = nsMap.keySet().iterator();
-                String key;
-                while (keys.hasNext()) {
-                    key = (String) keys.next();
-                    schemaColl.mapNamespace(key, (String) nsMap.get(key));
-                }
-                Schema schema;
-
-                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
-                    schema = (Schema) extensiblityElt;
-                    Stack importedSchemaStack = schema.getImportedSchemaStack();
-                    //compile these schemas
-                    while (!importedSchemaStack.isEmpty()) {
-                        Element el = (Element) importedSchemaStack.pop();
-                        if (el != null) {
-                            XmlSchema thisSchema = schemaColl.read(el);
-                            xmlSchemaTypeVector.add(thisSchema);
-                        }
-                    }
-                }
-            }
             //call the schema compiler
             CompilerOptions options = new CompilerOptions();
 
@@ -112,7 +66,7 @@
 
             SchemaCompiler schemaCompiler = new SchemaCompiler(options);
             // run the schema compiler
-            schemaCompiler.compile(xmlSchemaTypeVector);
+            schemaCompiler.compile(schemaList);
 
             //create the type mapper
             JavaTypeMapper mapper = new JavaTypeMapper();

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/WSDLValidatorExtension.java Fri Apr  7 05:38:41 2006
@@ -22,66 +22,43 @@
 import org.apache.wsdl.WSDLTypes;
 import org.apache.wsdl.extensions.ExtensionConstants;
 import org.apache.wsdl.extensions.Schema;
+import org.apache.ws.commons.schema.XmlSchema;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.NodeList;
 
 import java.util.Iterator;
+import java.util.List;
 
 import javax.xml.namespace.QName;
 
 public class WSDLValidatorExtension extends AbstractCodeGenerationExtension {
-    private static String TARGETNAMESPACE_STRING = "targetNamespace";
-
 
     public void engage() throws CodeGenerationException {
         //WSDLDescription wom = this.configuration.getWom();
-        WSDLTypes typesList = configuration.getWom().getTypes();
-        if (typesList == null) {
+        List schemaList = configuration.getAxisService().getSchema();
+        if (schemaList == null || schemaList.isEmpty()) {
             //there are no types to be considered
             return;
         }
-        Iterator iterator = typesList.getExtensibilityElements().iterator();
-        while (iterator.hasNext()) {
-            WSDLExtensibilityElement element = (WSDLExtensibilityElement) iterator.next();
-            boolean targetnamespaceFound = false;
-            if (ExtensionConstants.SCHEMA.equals(element.getType())) {
-                Schema schema = (Schema) element;
-                Element schemaElement = schema.getElement();
-                //first check whether the schema include import statements.
-                //As per the nature of WSDL if the schema has imports ONLY, then the
-                //schema element need not contain a target namespace.
-                NodeList importNodeList = schemaElement.getElementsByTagNameNS(schemaElement.getNamespaceURI(), "import");
-                NodeList allNodes = schemaElement.getElementsByTagName("*");
-
-                //checking the number of child elements and the number of import elements should get us what we need
-                //if these match, that means we have only import statements
-
-                if (importNodeList.getLength()== allNodes.getLength()) {
-                    return;
-                }
-
 
-                NamedNodeMap attributes = schemaElement.getAttributes();
-                for (int i = 0; i < attributes.getLength(); i++) {
-
-                    if (TARGETNAMESPACE_STRING.equalsIgnoreCase(
-                            attributes.item(i).getNodeName())) {
-                        targetnamespaceFound = true;
-                        break;
-                    }
-                }
-                if (!targetnamespaceFound) {
-                    
-                    // if there's no targetNamespace there's probably no name, but try it anyway
-                    QName qname = schema.getName();
-                    String name = qname == null ? "unknown schema" : qname.toString();
+        for (int i = 0; i < schemaList.size(); i++) {
+            XmlSchema s =  (XmlSchema)schemaList.get(i);
+            if (s.getIncludes().getCount()!=0){
+                //there are some included - now see whether there are any
+                //elements or types declared!
+                if (s.getElements().getCount()==0 &&
+                    s.getSchemaTypes().getCount()==0 &&
+                    s.getGroups().getCount()==0 &&
+                    s.getTargetNamespace()==null){
+                  // if there's no targetNamespace there's probably no name, but try it anyway
                     throw new CodeGenerationException(
-                        CodegenMessages.getMessage("extension.invalidWSDL",name));
+                        CodegenMessages.getMessage("extension.invalidWSDL",s.toString()));
                 }
 
             }
-
         }
+
+
     }
 }

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Fri Apr  7 05:38:41 2006
@@ -41,6 +41,11 @@
 import org.apache.xmlbeans.XmlBeans;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
+import org.apache.xmlbeans.impl.tool.SchemaCompilerExtension;
+import org.apache.xmlbeans.impl.tool.SchemaCompiler;
+import org.apache.xmlbeans.impl.tool.Extension;
+import org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler;
+import org.apache.ws.commons.schema.XmlSchema;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -56,6 +61,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.Writer;
+import java.io.ByteArrayOutputStream;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -79,7 +85,7 @@
     public static final String SCHEMA_PATH = "/org/apache/axis2/wsdl/codegen/schema/";
 
     boolean debug = false;
-    
+
     public void engage() {
 
         //test the databinding type. If not just fall through
@@ -88,7 +94,7 @@
         }
 
         //check the comptibilty
-        checkCompatibility();
+        //checkCompatibility();
 
         // Note  - typically we  need to check the presence of unwrapped or wrapped
         // parameter style  here. However XMLBeans nicely generates classes for all
@@ -99,10 +105,10 @@
 
         try {
             //get the types from the types section
-            WSDLTypes typesList = configuration.getWom().getTypes();
+            ArrayList schemas = configuration.getAxisService().getSchema();
 
             //check for the imported types. Any imported types are supposed to be here also
-            if (typesList == null) {
+            if (schemas == null || schemas.isEmpty()) {
                 //there are no types to be code generated
                 //However if the type mapper is left empty it will be a problem for the other
                 //processes. Hence the default type mapper is set to the configuration
@@ -110,64 +116,29 @@
                 return;
             }
 
-            List typesArray = typesList.getExtensibilityElements();
-            //this a list that keeps the already processed schemas
-            List processedSchemas = new ArrayList();
+            // todo - improve this code by using the schema compiler from
+            //xmlbeans directly
 
-            WSDLExtensibilityElement extensiblityElt;
             SchemaTypeSystem sts;
             Vector xmlObjectsVector = new Vector();
             //create the type mapper
             JavaTypeMapper mapper = new JavaTypeMapper();
+            Map nameSpacesMap = configuration.getAxisService().getNameSpacesMap();
+            for (int i = 0; i < schemas.size(); i++) {
 
-            for (int i = 0; i < typesArray.size(); i++) {
-                extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
-                Schema schema;
-
-                if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
-                    schema = (Schema) extensiblityElt;
-                    XmlOptions options = new XmlOptions();
-
-                    options.setLoadAdditionalNamespaces(
-                            configuration.getWom().getNamespaces()); //add the namespaces
-
-
-                    Stack importedSchemaStack = schema.getImportedSchemaStack();
-                    File schemaFolder = null;
-                    if(debug) {
-                        schemaFolder = new File(configuration.getOutputLocation(), SCHEMA_FOLDER);
-                        schemaFolder.mkdir();
-                    }
-                    //compile these schemas
-                    while (!importedSchemaStack.isEmpty()) {
-                        Element element = (Element) importedSchemaStack.pop();
-                        String tagetNamespace = element.getAttribute("targetNamespace");
-                        if (!processedSchemas.contains(tagetNamespace)) {
-
-                            if(debug) {
-                                // we are not using DOM toString method here, as it seems it depends on the
-                                // JDK version that is being used.
-                                String s = DOM2Writer.nodeToString(element);
-    
-                                //write the schema to a file
-                                File tempFile = File.createTempFile("temp", ".xsd", schemaFolder);
-                                FileWriter writer = new FileWriter(tempFile);
-                                writer.write(s);
-                                writer.flush();
-                                writer.close();
-                            }
-
-                            xmlObjectsVector.add(
-                                    XmlObject.Factory.parse(
-                                            element
-                                            , options));
+                XmlSchema schema = (XmlSchema) schemas.get(i);
+                XmlOptions options = new XmlOptions();
+
+                options.setLoadAdditionalNamespaces(
+                        nameSpacesMap); //add the namespaces
+                xmlObjectsVector.add(
+                        XmlObject.Factory.parse(
+                                getSchemaAsString(schema)
+                                ,options));
 
-                            processedSchemas.add(tagetNamespace);
-                        }
-                    }
-                }
             }
 
+
             // add the third party schemas
             //todo perhaps checking the namespaces would be a good idea to
             //make the generated code work efficiently
@@ -203,10 +174,7 @@
             //set the type mapper to the config
             configuration.setTypeMapper(mapper);
 
-            if(debug) {
-                // write the mapper to a file for later retriival
-                writeMappingsToFile(mapper.getAllMappedNames());
-            }
+
 
         } catch (Exception e) {
             throw new RuntimeException(e);
@@ -214,30 +182,6 @@
 
     }
 
-    private void writeMappingsToFile(Map typeMappings) throws IOException {
-
-        File typeMappingFolder = new File(configuration.getOutputLocation(), MAPPING_FOLDER);
-        if (!typeMappingFolder.exists()) {
-            typeMappingFolder.mkdir();
-        }
-
-        File typeMappingFile = File.createTempFile(MAPPER_FILE_NAME, ".xml", typeMappingFolder);
-        BufferedWriter out = new BufferedWriter(new FileWriter(typeMappingFile));
-        out.write("<" + MAPPINGS + ">");
-
-        Iterator iterator = typeMappings.keySet().iterator();
-        while (iterator.hasNext()) {
-            QName qName = (QName) iterator.next();
-            String fullJavaName = (String) typeMappings.get(qName);
-            out.write("<" + MAPPING + ">");
-            out.write("<" + MESSAGE + ">" + qName.getLocalPart() + "</" + MESSAGE + ">");
-            out.write("<" + JAVA_NAME + ">" + fullJavaName + "</" + JAVA_NAME + ">");
-            out.write("</" + MAPPING + ">");
-        }
-        out.write("</" + MAPPINGS + ">");
-        out.close();
-
-    }
 
     /**
      * Populate the base64 types
@@ -251,7 +195,7 @@
         List allSeenTypes = new ArrayList();
         List base64ElementQNamesList = new ArrayList();
         SchemaType outerType;
-        //add the document types and global types
+//add the document types and global types
         allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
         allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
         for (int i = 0; i < allSeenTypes.size(); i++) {
@@ -260,8 +204,8 @@
             if (sType.getContentType() == SchemaType.SIMPLE_CONTENT && sType.getPrimitiveType() != null) {
                 if (Constants.BASE_64_CONTENT_QNAME.equals(sType.getPrimitiveType().getName())) {
                     outerType = sType.getOuterType();
-                    //check the outer type further to see whether it has the contenttype attribute from
-                    //XMime namespace
+//check the outer type further to see whether it has the contenttype attribute from
+//XMime namespace
                     SchemaProperty[] properties = sType.getProperties();
                     for (int j = 0; j < properties.length; j++) {
                         if (Constants.XMIME_CONTENT_TYPE_QNAME.equals(properties[j].getName())) {
@@ -277,43 +221,43 @@
 
         configuration.putProperty(XSLTConstants.BASE_64_PROPERTY_KEY, base64ElementQNamesList);
     }
-    
+
     private void findPlainBase64Types(SchemaTypeSystem sts) {
         ArrayList allSeenTypes = new ArrayList();
-        
+
         allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
         allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
-        
+
         ArrayList base64Types = new ArrayList();
-        
+
         for (Iterator iterator = allSeenTypes.iterator(); iterator.hasNext(); ) {
             SchemaType stype = (SchemaType) iterator.next();
             findPlainBase64Types(stype, base64Types);
         }
-        
+
         configuration.putProperty(XSLTConstants.PLAIN_BASE_64_PROPERTY_KEY, base64Types);
     }
-    
+
     private void findPlainBase64Types(SchemaType stype, ArrayList base64Types) {
-        
+
         SchemaProperty[] elementProperties = stype.getElementProperties();
-        
+
         for (int i = 0; i < elementProperties.length; i++) {
             SchemaType schemaType = elementProperties[i].getType();
-            
+
             if (schemaType.isPrimitiveType()) {
                 SchemaType primitiveType = schemaType.getPrimitiveType();
-            
+
                 if (Constants.BASE_64_CONTENT_QNAME.equals(primitiveType.getName())) {
                     base64Types.add(elementProperties[i].getName());
                 }
-                
+
             } else {
-                findPlainBase64Types(schemaType, base64Types);                      
-            }  
+                findPlainBase64Types(schemaType, base64Types);
+            }
         }
     }
-    
+
     /**
      * Loading the external schemas.
      *
@@ -356,43 +300,6 @@
     }
 
 
-    /**
-     * Checking the compatibilty has to do with generating RPC/encoded stubs.
-     * If the XMLBeans bindings are used encoded binding cannot be done.
-     */
-    private void checkCompatibility() {
-        Map bindingMap = this.configuration.getWom().getBindings();
-        Collection col = bindingMap.values();
-
-        for (Iterator iterator = col.iterator(); iterator.hasNext();) {
-            WSDLBinding b = (WSDLBinding) iterator.next();
-            HashMap bindingOps = b.getBindingOperations();
-            Collection bindingOpsCollection = bindingOps.values();
-            for (Iterator iterator1 = bindingOpsCollection.iterator(); iterator1.hasNext();) {
-                checkInvalidUse((WSDLBindingOperation) iterator1.next());
-            }
-
-        }
-    }
-
-    protected void checkInvalidUse(WSDLBindingOperation bindingOp) {
-        WSDLBindingMessageReference input = bindingOp.getInput();
-        if (input != null) {
-            Iterator extIterator = input.getExtensibilityElements()
-                    .iterator();
-            while (extIterator.hasNext()) {
-                WSDLExtensibilityElement element = (WSDLExtensibilityElement) extIterator.next();
-                if (ExtensionConstants.SOAP_11_BODY.equals(element.getType()) ||
-                        ExtensionConstants.SOAP_12_BODY.equals(element.getType())) {
-                    if (WSDLConstants.WSDL_USE_ENCODED.equals(
-                            ((SOAPBody) element).getUse())) {
-                        throw new RuntimeException(
-                                CodegenMessages.getMessage("extension.encodedNotSupported"));
-                    }
-                }
-            }
-        }
-    }
 
     private XmlObject[] convertToXMLObjectArray(Vector vec) {
         return (XmlObject[]) vec.toArray(new XmlObject[vec.size()]);
@@ -432,6 +339,17 @@
     }
 
     /**
+     * Convert schema into a String
+     * @param schema
+     * @return
+     */
+    private String getSchemaAsString(XmlSchema schema){
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        schema.write(baos);
+        return baos.toString();
+    }
+
+    /**
      * Custom binding configuration for the code generator. This controls
      * how the namespaces are suffixed/prefixed
      */
@@ -440,5 +358,24 @@
             return URLProcessor.makePackageName(uri);
         }
     }
+
+//    /**
+//     *
+//     */
+//    public static class Axis2SchemaCompilerExtension implements SchemaCompilerExtension{
+//        private SchemaTypeSystem sts;
+//
+//        public SchemaTypeSystem getSts() {
+//            return sts;
+//        }
+//
+//        public void schemaCompilerExtension(SchemaTypeSystem schemaTypeSystem, Map parms) {
+//            this.sts = schemaTypeSystem;
+//        }
+//
+//        public String getExtensionName() {
+//            return "Axis2.xmlbeans.extension";
+//        }
+//    }
 }
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Fri Apr  7 05:38:41 2006
@@ -217,7 +217,7 @@
                                     new java.lang.String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
                                     new java.lang.Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                                 </xsl:when>
-                                <xsl:when test="$style='doc'">
+                                <xsl:when test="$style='document'">
                                     //Style is Doc.
                                     <!-- Let's assume there is only one parameters here -->
                                     <xsl:for-each select="input/param[@location='body']">
@@ -240,7 +240,7 @@
                                 </xsl:when>
                                 <xsl:otherwise>
                                     //Unknown style!! No code is generated
-                                    throw java.lang.UnsupportedOperationException("Unknown Style");
+                                    throw new java.lang.UnsupportedOperationException("Unknown Style");
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:when>
@@ -251,13 +251,13 @@
                                     //Style is RPC. No input parameters
                                     org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_operationClient.getOptions().getSoapVersionURI()), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
                                 </xsl:when>
-                                <xsl:when test="$style='doc'">
+                                <xsl:when test="$style='document'">
                                     //Style is Doc. No input parameters
                                     <!-- setValueDoc(env,null); -->
                                 </xsl:when>
                                 <xsl:otherwise>
                                     //Unknown style!! No code is generated
-                                    throw UnsupportedOperationException("Unknown Style");
+                                    throw new UnsupportedOperationException("Unknown Style");
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:otherwise>
@@ -283,7 +283,7 @@
                 org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
                 <!-- todo need to change this to cater for unwrapped messages (multiple parts) -->
                 <xsl:choose>
-                    <xsl:when test="$style='doc'">
+                    <xsl:when test="$style='document'">
                            java.lang.Object object = fromOM(getElement(_returnEnv,"<xsl:value-of select="$style"/>"),<xsl:value-of select="$outputtype"/>.class);
                           
                            _messageContext.getTransportOut().getSender().cleanUp(_messageContext);
@@ -292,7 +292,7 @@
                     </xsl:when>
                     <xsl:otherwise>
                         //Unsupported style!! No code is generated
-                        throw java.lang.UnsupportedOperationException("Unsupported Style");
+                        throw new java.lang.UnsupportedOperationException("Unsupported Style");
                     </xsl:otherwise>
                 </xsl:choose>
             </xsl:otherwise>
@@ -335,7 +335,7 @@
                                     new java.lang.String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
                                     new java.lang.Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                                 </xsl:when>
-                                <xsl:when test="$style='doc'">
+                                <xsl:when test="$style='document'">
                                     //Style is Doc.
                                     <xsl:for-each select="input/param[@location='body']">
                                         <xsl:choose>
@@ -356,7 +356,7 @@
                                 </xsl:when>
                                 <xsl:otherwise>
                                     //Unknown style!! No code is generated
-                                    throw java.lang.UnsupportedOperationException("Unknown Style");
+                                    throw new java.lang.UnsupportedOperationException("Unknown Style");
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:when>
@@ -367,13 +367,13 @@
                                     //Style is RPC. No input parameters
                                     org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_operationClient.getOptions().getSoapVersionURI()), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
                                 </xsl:when>
-                                <xsl:when test="$style='doc'">
+                                <xsl:when test="$style='document'">
                                     //Style is Doc. No input parameters
                                     <!-- setValueDoc(env,null); -->
                                 </xsl:when>
                                 <xsl:otherwise>
                                     //Unknown style!! No code is generated
-                                    throw UnsupportedOperationException("Unknown Style");
+                                    throw new UnsupportedOperationException("Unknown Style");
                                 </xsl:otherwise>
                             </xsl:choose>
                         </xsl:otherwise>
@@ -396,7 +396,7 @@
                     public void onComplete(
                             org.apache.axis2.client.async.AsyncResult result) {
                         java.lang.Object object = fromOM(getElement(
-                                result.getResponseEnvelope(), "doc"),
+                                result.getResponseEnvelope(), "document"),
                                <xsl:value-of select="$outputtype"/>.class);
                         callback.receiveResult<xsl:value-of select="@name"/>((<xsl:value-of select="$outputtype"/>) object);
                     }
@@ -449,14 +449,14 @@
                                 new java.lang.String[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if>"<xsl:value-of select="@name"/>"</xsl:for-each>},
                                 new java.lang.Object[]{<xsl:for-each select="input/param[@type!='']"><xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/></xsl:for-each>});
                             </xsl:when>
-                            <xsl:when test="$style='doc'">
+                            <xsl:when test="$style='document'">
                                 <!-- for the doc lit case there can be only one element. So take the first element -->
                                 //Style is Doc.
                                 env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), <xsl:value-of select="input/param[1]/@name"/>, optimizeContent(new javax.xml.namespace.QName("<xsl:value-of select="$method-ns"/>", "<xsl:value-of select="$method-name"/>")));
                             </xsl:when>
                             <xsl:otherwise>
                                 //Unknown style!! No code is generated
-                                throw java.lang.UnsupportedOperationException("Unknown Style");
+                                throw new java.lang.UnsupportedOperationException("Unknown Style");
                             </xsl:otherwise>
                         </xsl:choose>
                     </xsl:when>
@@ -467,13 +467,13 @@
                                 //Style is RPC. No input parameters
                                 org.apache.axis2.rpc.client.RPCStub.setValueRPC(getFactory(_operationClient.getOptions().getSoapVersionURI()), env,"<xsl:value-of select="@namespace"/>","<xsl:value-of select="@name"/>",null,null);
                             </xsl:when>
-                            <xsl:when test="$style='doc'">
+                            <xsl:when test="$style='document'">
                                 //Style is Doc. No input parameters
                                 <!-- setValueDoc(env,null); -->
                             </xsl:when>
                             <xsl:otherwise>
                                 //Unknown style!! No code is generated
-                                throw UnsupportedOperationException("Unknown Style");
+                                throw new UnsupportedOperationException("Unknown Style");
                             </xsl:otherwise>
                         </xsl:choose>
                     </xsl:otherwise>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl?rev=392263&r1=392262&r2=392263&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/MessageReceiverTemplate.xsl Fri Apr  7 05:38:41 2006
@@ -80,7 +80,7 @@
                     //rpc style  -- this needs to be filled
 
                 </xsl:when>
-                <xsl:when test="$style='doc'">
+                <xsl:when test="$style='document'">
                     //doc style
                     <xsl:if test="$returntype!=''"><xsl:value-of select="$returnvariable"/> =</xsl:if>
                     <xsl:variable name="paramCount"> <xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
@@ -106,7 +106,7 @@
 
                 <xsl:otherwise>
                     //Unknown style!! No code is generated
-                    throw UnsupportedOperationException("Unknown Style");
+                    throw new UnsupportedOperationException("Unknown Style");
                 </xsl:otherwise>
             </xsl:choose>
 
@@ -186,7 +186,7 @@
                     //rpc style  -- this needs to be filled
 
                 </xsl:when>
-                <xsl:when test="$style='doc'">
+                <xsl:when test="$style='document'">
                     //doc style
                     <xsl:variable name="paramCount"><xsl:value-of select="count(input/param[@location='body'])"/></xsl:variable>
                     <xsl:choose>
@@ -201,7 +201,7 @@
 
                 <xsl:otherwise>
                     //Unknown style!! No code is generated
-                    throw UnsupportedOperationException("Unknown Style");
+                    throw new UnsupportedOperationException("Unknown Style");
                 </xsl:otherwise>
             </xsl:choose>
 



Mime
View raw message