You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/08/09 13:14:03 UTC

svn commit: r231019 - in /webservices/axis/trunk/java/modules/wsdl: src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Author: ajith
Date: Tue Aug  9 04:13:14 2005
New Revision: 231019

URL: http://svn.apache.org/viewcvs?rev=231019&view=rev
Log:
1.changed the client emitter to have the data binding supporter name. Now the supporter name includes the portype name to avoid conflicts
2.Added a delete directory statement to the teatDown() method of the WSDL2Java test class

Modified:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
    webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java?rev=231019&r1=231018&r2=231019&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/emitter/MultiLanguageClientEmitter.java Tue Aug  9 04:13:14 2005
@@ -58,23 +58,15 @@
 *
 * Abstract Client emitter
 * the XML will look like the following
-* todo escape the following
-* <pre>
-<interface package="">
-<method name="">
-<input>
-<param name="" type=""/>*
-</input> ?
-<output>
-<param name="" type=""/>?
-</output>?
-</method>
-</interface>
-</pre>
+* todo Add references to relevant shcemas !
 */
 
 
 public abstract class MultiLanguageClientEmitter implements Emitter {
+    /*
+     *  Important! These constants are used in some places in the templates. Care should
+     *  be taken when changing them
+     */
     private static final String CALL_BACK_HANDLER_SUFFIX = "CallbackHandler";
     private static final String STUB_SUFFIX = "Stub";
     private static final String TEST_SUFFIX = "Test";
@@ -263,11 +255,12 @@
     protected void writeDatabindingSupporters(WSDLBinding axisBinding) throws Exception {
         Collection col = axisBinding.getBoundInterface().getOperations()
                 .values();
+        String portTypeName = axisBinding.getBoundInterface().getName().getLocalPart();
         for (Iterator iterator = col.iterator(); iterator.hasNext();) {
             //Note -  there will be a supporter generated per method and will contain the methods to serilize and
-            //deserilize the relevant objects
+            //deserailize the relevant objects
             Document databindingSupporterModel = createDOMDocumentforSerialization(
-                    (WSDLOperation) iterator.next());
+                    (WSDLOperation) iterator.next(),portTypeName);
             ClassWriter databindingSupportWriter = new DatabindingSupportClassWriter(
                     this.configuration.getOutputLocation(),
                     this.configuration.getOutputLanguage(),
@@ -749,6 +742,9 @@
                                 Element rootElement,
                                 WSDLBinding binding) {
         Collection col = boundInterface.getOperations().values();
+
+        String portTypeName = boundInterface.getName().getLocalPart();
+
         Element methodElement = null;
         WSDLOperation operation = null;
 
@@ -764,7 +760,7 @@
             addAttribute(doc, "style", operation.getStyle(), methodElement);
             addAttribute(doc,
                     "dbsupportname",
-                    localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
+                    portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                     methodElement);
             if (null != binding) {
                 WSDLBindingOperation bindingOperation =
@@ -881,7 +877,8 @@
     }
 
     protected Document createDOMDocumentforSerialization(
-            WSDLOperation operation) {
+            WSDLOperation operation,String portTypeName) {
+
         Document doc = getEmptyDocument();
         Element rootElement = doc.createElement("class");
         addAttribute(doc,
@@ -892,7 +889,7 @@
         String localPart = operation.getName().getLocalPart();
         addAttribute(doc,
                 "name",
-                localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
+                portTypeName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                 rootElement);
         addAttribute(doc, "methodname", localPart, rootElement);
         addAttribute(doc,

Modified: webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java?rev=231019&r1=231018&r2=231019&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/test/org/apache/axis2/wsdl/codegen/WSDL2JavaTest.java Tue Aug  9 04:13:14 2005
@@ -50,7 +50,7 @@
     protected void tearDown() throws Exception {
         File outputFile = new File(OUTPUT_LOCATION);
         if (outputFile.exists() && outputFile.isDirectory()){
-            //deleteDir(outputFile);
+            deleteDir(outputFile);
         }
     }
 
@@ -122,7 +122,7 @@
         javaCompiler.setProject(codeGenProject);
         javaCompiler.setIncludejavaruntime(true);
         javaCompiler.setIncludeantruntime(true);
-        
+
         File outputLocationFile = new File(OUTPUT_LOCATION);
 
         Path classPath = new Path(codeGenProject,OUTPUT_LOCATION) ;