axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashut...@apache.org
Subject svn commit: r240243 - in /webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension: ./ org/ org/apache/ org/apache/axis2/ org/apache/axis2/wsdl/ org/apache/axis2/wsdl/codegen/ org/apache/axis2/wsdl/codegen/extension/ org/...
Date Fri, 26 Aug 2005 13:34:04 GMT
Author: ashutosh
Date: Fri Aug 26 06:33:51 2005
New Revision: 240243

URL: http://svn.apache.org/viewcvs?rev=240243&view=rev
Log:
JAXB Databinding extension for Axis2. Putting in scratch as it depends on JAXB 2.0 RI.

Added:
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/JAXBExtension.java
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/JAXBSupporterTemplate.xsl
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/
    webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/ConfigPropertyFileLoader.java

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties?rev=240243&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties
(added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties
Fri Aug 26 06:33:51 2005
@@ -0,0 +1,6 @@
+#######################################################################################################################
+#####################   code generator property file  #################################################################
+#######################################################################################################################
+#Extensions - The extensions are comma seperated
+#these are loaded in their lexical order
+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.JAXBExtension,org.apache.axis2.wsdl.codegen.extension.DefaultDatabindingExtension
\ No newline at end of file

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/JAXBExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/JAXBExtension.java?rev=240243&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/JAXBExtension.java
(added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/codegen/extension/JAXBExtension.java
Fri Aug 26 06:33:51 2005
@@ -0,0 +1,151 @@
+package org.apache.axis2.wsdl.codegen.extension;
+
+import java.io.*;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.wsdl.WSDLException;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
+import org.apache.axis2.wsdl.codegen.CodeGenerationException;
+import org.apache.axis2.wsdl.codegen.CommandLineOption;
+import org.apache.axis2.wsdl.codegen.CommandLineOptionConstants;
+import org.apache.axis2.wsdl.databinding.DefaultTypeMapper;
+import org.apache.axis2.wsdl.databinding.JavaTypeMapper;
+import org.apache.axis2.wsdl.util.XMLUtils;
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.apache.wsdl.WSDLTypes;
+
+import com.sun.codemodel.JCodeModel;
+import com.sun.tools.xjc.Plugin;
+import com.sun.tools.xjc.XJC2Task;
+import com.sun.tools.xjc.api.Mapping;
+import com.sun.tools.xjc.api.S2JJAXBModel;
+import com.sun.tools.xjc.api.SchemaCompiler;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+import com.sun.tools.xjc.api.XJC;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.*;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Target;
+
+public class JAXBExtension extends AbstractCodeGenerationExtension implements
+		CodeGenExtension {
+	private static final String DEFAULT_STS_NAME = "foo";
+
+	public void init(CodeGenConfiguration configuration) {
+		this.configuration = configuration;
+	}
+
+	public void engage() throws CodeGenerationException {
+		
+		try {
+			
+			WSDLTypes typesList = configuration.getWom().getTypes();
+            if (typesList == null) {
+                //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
+                this.configuration.setTypeMapper(new DefaultTypeMapper());
+                return;
+            }
+            
+            List typesArray = typesList.getExtensibilityElements();
+            WSDLExtensibilityElement extensiblityElt = null;
+            
+            
+            //Get the schema information from WSDL by parsing it in a DOM document
+            //and extracting the schema part
+            
+            String uri = ((CommandLineOption)configuration.getParser().getAllOptions().get(
+            		CommandLineOptionConstants.WSDL_LOCATION_URI_OPTION)).getOptionValue();
+            File file = new File(uri);
+            
+            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);
+            }
+             
+            Node schemaNode = getSchemaNode(doc);
+            String schemaStr = parseToString(schemaNode);
+           
+            //invoke XJC programatically
+            SchemaCompiler sc = XJC.createSchemaCompiler();
+         
+            StringReader sr = new StringReader(schemaStr);
+            BufferedReader br = new BufferedReader(sr); 
+            InputSource is = new InputSource(br);
+            is.setSystemId("www.SystemId.org");
+            sc.parseSchema(is);
+            S2JJAXBModel jaxbModel = sc.bind();
+            
+            //Write Java files created from schema
+            JCodeModel cm = jaxbModel.generateCode(new Plugin[]{}, null);
+            String outputDir = ((CommandLineOption)configuration.getParser().getAllOptions().get(
+            		CommandLineOptionConstants.OUTPUT_LOCATION_OPTION)).getOptionValue();
+            cm.build(new File(outputDir));
+            
+            //Polulate typemapper
+            Iterator mappingsIter =  jaxbModel.getMappings().iterator();
+            JavaTypeMapper mapper = new JavaTypeMapper();
+            while(mappingsIter.hasNext()){
+            	Mapping mapping = (Mapping)mappingsIter.next();
+            	QName xmlType = mapping.getElement();
+            	String javaType = mapping.getType().getTypeClass();
+            	System.out.println(xmlType + " ::: " + javaType);
+            	mapper.addTypeMapping(xmlType, javaType);
+            }
+            this.configuration.setTypeMapper(mapper);
+			
+		}catch (Exception e) {
+			 throw new RuntimeException(e);
+		}
+
+	}
+	
+	private Node getSchemaNode(Document doc){
+		Node definition = doc.getFirstChild();
+		QName schemaName = new QName("http://www.w3.org/2001/XMLSchema", "schema");
+		Node schema = XMLUtils.findNode(definition, schemaName);
+		//Attr attrib = doc.createAttributeNS("http://www.w3.org/2001/XMLSchema", new QName("xsd").toString());
+		Attr attrib = doc.createAttribute("xmlns:xsd");
+		attrib.setValue("http://www.w3.org/2001/XMLSchema");
+		((Element)schema).setAttributeNode(attrib);
+		return schema;
+	}
+	
+	private static String parseToString (Node node)throws TransformerException{
+		
+		StringBuffer buffer = new StringBuffer();
+		Transformer transformer = TransformerFactory.newInstance().newTransformer();
+		StringWriter stringWriter = new StringWriter(128);
+		transformer.transform(new DOMSource(node), new StreamResult(stringWriter));
+		buffer =  stringWriter.getBuffer();
+		return buffer.toString();
+	}
+
+}

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/JAXBSupporterTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/JAXBSupporterTemplate.xsl?rev=240243&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/JAXBSupporterTemplate.xsl
(added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/JAXBSupporterTemplate.xsl
Fri Aug 26 06:33:51 2005
@@ -0,0 +1,107 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="text"/>
+    <xsl:template match="/class">
+    package <xsl:value-of select="@package"/>;
+    import java.io.FileOutputStream;
+    import java.io.FileInputStream;
+    
+    import javax.xml.bind.JAXBContext;
+    import javax.xml.bind.Marshaller;
+    import javax.xml.bind.Unmarshaller;
+    import javax.xml.stream.*;
+    
+    /**
+     *  Auto generated supporter class for XML beans by the Axis code generator
+     */
+
+    public class <xsl:value-of select="@name"/> {
+             <xsl:apply-templates />
+
+          public static java.lang.Object fromOM(org.apache.axis2.om.OMElement param,
+               java.lang.Class type){
+                try{
+                	FileOutputStream fos = new FileOutputStream("_temp_");
+	                XMLStreamWriter writer = XMLOutputFactory.newInstance()
+			     	.createXMLStreamWriter(new FileOutputStream("_temp_"));
+			param.serialize(writer);
+	                writer.flush();
+	                fos.flush();
+	                fos.close();
+	                JAXBContext jaxbContext = JAXBContext.newInstance("org.simpletest.xsd");
+	                		//Above org.simpletest.xsd is being hardcoded, but it should actually
be the 
+	                		//package corresponding to targetnamespace of schema.
+	                Unmarshaller unmarsh = jaxbContext.createUnmarshaller();
+	                FileInputStream xmlContent = new FileInputStream("_temp_");
+
+                    <xsl:for-each select="param">
+                     <xsl:if test="@type!=''">
+                     if (<xsl:value-of select="@type"/>.class.equals(type)){
+                    	 <xsl:value-of select="@type"/> unmarshalledClazz = (<xsl:value-of
select="@type"/>)unmarsh.unmarshal(xmlContent);
+                         return unmarshalledClazz;
+                     }
+                     </xsl:if>
+                    </xsl:for-each>
+                 }catch(java.lang.Exception e){
+                    throw new RuntimeException("Data binding error",e);
+                }
+             return null;
+          }
+
+        //Generates an empty object for testing
+        // Caution - need some manual editing to work properly
+        
+         public static java.lang.Object getTestObject(java.lang.Class type){
+             //Returning empty object for compilation to succeed. Don't rely on
+             //using the test object out of this method, as it is.
+             try {
+             <xsl:for-each select="param">
+	        <xsl:if test="@type!=''">
+                    if (<xsl:value-of select="@type"/>.class.equals(type)){
+                    <xsl:value-of select="@type"/> emptyObject= <xsl:value-of select="@type"/>.class.newInstance();
+                    return emptyObject;
+                    }
+                </xsl:if>
+             </xsl:for-each>
+             return null;
+             } catch(java.lang.Exception e){
+                 throw new RuntimeException("Test object creation failure",e);
+             }
+          }
+          
+     }
+    </xsl:template>
+    
+    <xsl:template match="param">
+        <xsl:if test="@type!=''">
+          public  static org.apache.axis2.om.OMElement  toOM(<xsl:value-of select="@type"/>
param){
+          try {
+          	JAXBContext jaxbContext = JAXBContext.newInstance("org.simpletest.xsd");
+          		//Above org.simpletest.xsd is being hardcoded, but it should actually be the

+	              	//package corresponding to targetnamespace of schema.
+        	Marshaller marsh = jaxbContext.createMarshaller();
+        		//we want the output to be neatly indented, right?
+        	marsh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
+        			   new Boolean(true));
+        	FileOutputStream tempFOP = new FileOutputStream("_temp_");
+        	System.out.println("JAXB marshalled output of the java instance:");
+        	marsh.marshal(param,System.out);
+        	marsh.marshal(param, tempFOP);
+ 
+        	tempFOP.flush();
+        	tempFOP.close();
+        	XMLStreamReader reader = XMLInputFactory.newInstance().
+     			createXMLStreamReader(new FileInputStream("_temp_"));
+		org.apache.axis2.om.impl.llom.builder.StAXOMBuilder builder = new org.apache.axis2.om.impl.llom.builder.StAXOMBuilder
+			(org.apache.axis2.om.OMAbstractFactory.getOMFactory(),new org.apache.axis2.clientapi.StreamWrapper(reader))
;
+		org.apache.axis2.om.OMElement documentElement = builder.getDocumentElement();
+		//Building the element is needed to avoid certain stream errors!
+		documentElement.build();
+		return documentElement;
+	  } catch(Exception e) {
+        	System.err.println("Exception encountered in echoStringDatabindingSupporter.toOM().
Returning null");
+      	  }
+        	return null;
+         }
+       </xsl:if>
+    </xsl:template>
+ </xsl:stylesheet>
\ No newline at end of file

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=240243&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
(added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
Fri Aug 26 06:33:51 2005
@@ -0,0 +1,140 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+    <xsl:output method="text"/>
+    <xsl:template match="/class">
+    <xsl:variable name="interfaceName"><xsl:value-of select="@interfaceName"/></xsl:variable>
+    <xsl:variable name="package"><xsl:value-of select="@package"/></xsl:variable>
+    <xsl:variable name="callbackname"><xsl:value-of select="@callbackname"/></xsl:variable>
+    <xsl:variable name="stubname"><xsl:value-of select="@stubname"/></xsl:variable>
+    <xsl:variable name="isSync"><xsl:value-of select="@isSync"/></xsl:variable>
+    <xsl:variable name="isAsync"><xsl:value-of select="@isAsync"/></xsl:variable>
+    <xsl:variable name="dbpackage"><xsl:value-of select="@dbsupportpackage"/></xsl:variable>
+
+    package <xsl:value-of select="$package"/>;
+    
+	import java.io.InputStream;
+	import java.net.ServerSocket;
+
+	import javax.xml.namespace.QName;
+	
+	import org.apache.axis2.context.ConfigurationContext;
+	import org.apache.axis2.deployment.DeploymentEngine;
+	import org.apache.axis2.description.ServiceDescription;
+	import org.apache.axis2.engine.AxisConfiguration;
+	import org.apache.axis2.wsdl.codegen.Constants;
+	import org.apache.axis2.om.OMAbstractFactory;
+	import org.apache.axis2.om.OMElement;
+	import org.apache.axis2.om.OMFactory;
+	import org.apache.axis2.om.impl.llom.OMTextImpl;
+	import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+
+    /*
+     *  Auto generated Junit test case by the Axis code generator
+    */
+
+    public class <xsl:value-of select="@name"/> extends junit.framework.TestCase{
+
+     <xsl:for-each select="method">
+         <xsl:if test="@mep='http://www.w3.org/2004/08/wsdl/in-out'">
+          <xsl:variable name="outputtype"><xsl:value-of select="output/param/@type"></xsl:value-of></xsl:variable>
+          <xsl:variable name="dbsupportclassname"><xsl:value-of select="@dbsupportname"></xsl:value-of></xsl:variable>
+          <xsl:if test="$isSync='1'">
+        /**
+         * Auto generated test method
+         */
+        public  void test<xsl:value-of select="@name"/>() throws java.lang.Exception{
+
+        <xsl:value-of select="$package"/>.<xsl:value-of select="$stubname"/>
stub =
+                    new <xsl:value-of select="$package"/>.<xsl:value-of select="$stubname"/>();//the
default implementation should point to the right endpoint
+          //create a new databinder
+        <xsl:variable name="fullsupporterclassname"><xsl:value-of select="$dbpackage"/>.<xsl:value-of
select="$dbsupportclassname"/></xsl:variable>
+        <xsl:value-of select="$fullsupporterclassname"/> databindSupporter = new <xsl:value-of
select="$fullsupporterclassname"/>();
+
+           <xsl:choose>
+             <xsl:when test="count(input/param)>0">
+<!--                //<xsl:variable name="firstInput"><xsl:value-of select="input/param[1]"/></xsl:variable>
 -->
+                <xsl:choose>
+                    <xsl:when test="$outputtype=''">
+                    <!-- for now think there is only one input element -->
+                    //There is no output to be tested!
+                    stub.<xsl:value-of select="@name"/>(
+                        <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of
select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>);
+                    </xsl:when>
+                    <xsl:otherwise>
+                        assertNotNull(stub.<xsl:value-of select="@name"/>(
+                        <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of
select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>));
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:when>
+              <xsl:otherwise>
+                  <xsl:choose>
+                    <xsl:when test="$outputtype=''">
+                    //There is no output to be tested!
+                    stub.<xsl:value-of select="@name"/>();
+                    </xsl:when>
+                    <xsl:otherwise>
+                    assertNotNull(stub.<xsl:value-of select="@name"/>());
+                    </xsl:otherwise>
+                </xsl:choose>
+             </xsl:otherwise>
+            </xsl:choose>
+
+
+
+        }
+        </xsl:if>
+        <xsl:if test="$isAsync='1'">
+            <xsl:variable name="tempCallbackName">tempCallback<xsl:value-of select="generate-id()"/></xsl:variable>
+         /**
+         * Auto generated test method
+         */
+        public  void testStart<xsl:value-of select="@name"/>() throws java.lang.Exception{
+            <xsl:value-of select="$package"/>.<xsl:value-of select="$stubname"/>
stub = new <xsl:value-of select="$package"/>.<xsl:value-of select="$stubname"/>();
+             //create a new databinder
+            <xsl:variable name="fullsupporterclassname"><xsl:value-of select="$dbpackage"/>.<xsl:value-of
select="$dbsupportclassname"/></xsl:variable>
+            <xsl:value-of select="$fullsupporterclassname"/> databindSupporter = new
<xsl:value-of select="$fullsupporterclassname"/>();
+             <xsl:choose>
+             <xsl:when test="count(input/param)>0">
+                stub.start<xsl:value-of select="@name"/>(
+                         <xsl:for-each select="input/param">
+                             <xsl:if test="@type!=''"><xsl:if test="position()>1">,</xsl:if>(<xsl:value-of
select="@type"/>)databindSupporter.getTestObject(<xsl:value-of select="@type"/>.class)
+                        </xsl:if>
+                        </xsl:for-each>,
+                    new <xsl:value-of select="$tempCallbackName"/>()
+                );
+              </xsl:when>
+              <xsl:otherwise>
+                stub.start<xsl:value-of select="@name"/>(
+                    new <xsl:value-of select="$tempCallbackName"/>()
+                );
+             </xsl:otherwise>
+            </xsl:choose>
+
+
+        }
+
+        private class <xsl:value-of select="$tempCallbackName"/>  extends <xsl:value-of
select="$package"/>.<xsl:value-of select="$callbackname"/>{
+            public <xsl:value-of select="$tempCallbackName"/>(){ super(null);}
+
+            public void receiveResult<xsl:value-of select="@name"/>(org.apache.axis2.clientapi.AsyncResult
result) {
+			    assertNotNull(result.getResponseEnvelope().getBody().getFirstChild());
+            }
+
+            public void receiveError<xsl:value-of select="@name"/>(java.lang.Exception
e) {
+                fail();
+            }
+
+        }
+      </xsl:if>
+      <!-- end of in-out mep -->
+      </xsl:if>
+     </xsl:for-each>
+	}
+    </xsl:template>
+ </xsl:stylesheet>
\ No newline at end of file

Added: webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/ConfigPropertyFileLoader.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/ConfigPropertyFileLoader.java?rev=240243&view=auto
==============================================================================
--- webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/ConfigPropertyFileLoader.java
(added)
+++ webservices/axis/trunk/archive/java/scratch/ashu_jaya_venkat/JAXB_Databinding_Extension/org/apache/axis2/wsdl/util/ConfigPropertyFileLoader.java
Fri Aug 26 06:33:51 2005
@@ -0,0 +1,40 @@
+package org.apache.axis2.wsdl.util;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+/**
+ * Tries to load the properties from the config properties
+ */
+public class ConfigPropertyFileLoader {
+
+    private static String[] extensionClassNames;
+
+    private static final String CODE_GEN_KEY = "codegen.extension";
+
+    static{
+        try {
+            InputStream stream = Object.class.getResourceAsStream("/org/apache/axis2/wsdl/codegen/codegen-config.properties");
+            //InputStream stream = Object.class.getResourceAsStream("/org/apache/axis2/wsdl/codegen/codegen-config-withJAXB.properties");
+            Properties props = new Properties();
+            props.load(stream);
+
+            String codeGenExtensionClasses = props.getProperty(CODE_GEN_KEY);
+            if (codeGenExtensionClasses!=null){
+                extensionClassNames = codeGenExtensionClasses.split(",");
+
+            }
+
+
+
+        } catch (IOException e) {
+           throw new RuntimeException(e);
+        }
+
+    }
+
+    public static String[] getExtensionClassNames() {
+        return extensionClassNames;
+    }
+}



Mime
View raw message