You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2006/07/09 12:57:17 UTC

svn commit: r420278 - in /webservices/axis2/trunk/java/modules: adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java

Author: ajith
Date: Sun Jul  9 03:57:17 2006
New Revision: 420278

URL: http://svn.apache.org/viewvc?rev=420278&view=rev
Log:
1. Changed the namespace uri of the operation to be the target namespace from the axis service in the AxisServiceBasedMultiLanguageEmitter.java
2. Changed the ADBDatabindingTemplate.xsl toEnvelope method to utilize the newly added getOMElement method from ADB beans. This should improve the performance but Dims would have to run the perf test to find out :)

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl?rev=420278&r1=420277&r2=420278&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBDatabindingTemplate.xsl Sun Jul  9 03:57:17 2006
@@ -12,7 +12,7 @@
             </xsl:for-each>
             };
         </xsl:if>
-        <!--  generate toOM for only non parts - this is WRONG!!!! -->
+        <!--  generate toOM for only non parts and non primitives!!! -->
         <xsl:for-each select="param[@type!='' and not(@primitive) and not(@partname)]">
             private  org.apache.axiom.om.OMElement  toOM(<xsl:value-of select="@type"/> param, boolean optimizeContent){
             return param.getOMElement(param.MY_QNAME,
@@ -25,12 +25,11 @@
             <xsl:variable name="opnsuri"><xsl:value-of select="@opnsuri"/></xsl:variable>
             <xsl:choose>
                 <xsl:when test="count(../../param[@type!='' and @direction='in' and @opname=$opname])=1">
+                    <!-- Assumption - The ADBBean here is always an element based bean -->
                     private  org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"/> param, boolean optimizeContent){
-                    //note - optimize content is not used here !
-                    org.apache.axis2.databinding.ADBSOAPModelBuilder builder =
-                    new org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(<xsl:value-of select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"/>.MY_QNAME),
-                    factory);
-                    return builder.getEnvelope();
+                     org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+                     emptyEnvelope.getBody().addChild(param.getOMElement(<xsl:value-of select="../../param[@type!='' and @direction='in' and @opname=$opname]/@type"/>.MY_QNAME,factory));
+                     return emptyEnvelope;
                     }
                 </xsl:when>
                 <xsl:when test="count(../../param[@type!='' and @direction='in' and @opname=$opname]) &gt; 1">
@@ -76,12 +75,11 @@
             </xsl:choose>
              <xsl:choose>
 			      <xsl:when test="count(../../param[@type!='' and @direction='out' and @opname=$opname])=1">
+                    <!-- Assumption - The ADBBean here is always an element based bean -->
                     private  org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, <xsl:value-of select="../../param[@type!='' and @direction='out' and @opname=$opname]/@type"/> param, boolean optimizeContent){
-                    //note - optimize content is not used here !
-                    org.apache.axis2.databinding.ADBSOAPModelBuilder builder =
-                    new org.apache.axis2.databinding.ADBSOAPModelBuilder(param.getPullParser(<xsl:value-of select="../../param[@type!='' and @direction='out' and @opname=$opname]/@type"/>.MY_QNAME),
-                    factory);
-                    return builder.getEnvelope();
+                     org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+                     emptyEnvelope.getBody().addChild(param.getOMElement(<xsl:value-of select="../../param[@type!='' and @direction='out' and @opname=$opname]/@type"/>.MY_QNAME,factory));
+                     return emptyEnvelope;
                     }
                 </xsl:when>
 	   </xsl:choose>

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=420278&r1=420277&r2=420278&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 Sun Jul  9 03:57:17 2006
@@ -1077,7 +1077,10 @@
             AxisOperation axisOperation = (AxisOperation) operationsIterator.next();
             elt = doc.createElement("name");
             elt.appendChild(doc.createTextNode(axisOperation.getName().getLocalPart()));
-            addAttribute(doc,"opnsuri",axisOperation.getName().getNamespaceURI(),elt);
+
+            //what needs to be put here as the opertation namespace is actually the
+            //traget namespace of the service
+            addAttribute(doc,"opnsuri",axisService.getTargetNamespace(),elt);
             root.appendChild(elt);
         }
 



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