You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ru...@apache.org on 2011/02/01 05:50:47 UTC
svn commit: r1065907 - in
/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl:
codegen/emitter/ template/java/
Author: ruwan
Date: Tue Feb 1 04:50:46 2011
New Revision: 1065907
URL: http://svn.apache.org/viewvc?rev=1065907&view=rev
Log:
Committing the fix for AXIS2-4914, patch from Pradeep
Modified:
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
Modified: axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=1065907&r1=1065906&r2=1065907&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java (original)
+++ axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java Tue Feb 1 04:50:46 2011
@@ -2279,11 +2279,20 @@ public class AxisServiceBasedMultiLangua
String localPart = axisOperation.getName().getLocalPart();
if (this.codeGenConfiguration.isUseOperationName()) {
- addAttribute(doc, "name", JavaUtils.xmlNameToJava(localPart), methodElement);
+ String temp = JavaUtils.xmlNameToJava(localPart);
+ addAttribute(doc, "name", temp, methodElement);
+ // we need first character capitalized version at times,
+ // to preserve the CamelCase name generation
+ addAttribute(doc,"firstCharCapitalizedName",
+ JavaUtils.capitalizeFirstChar(temp), methodElement);
} else {
- addAttribute(doc, "name", JavaUtils.xmlNameToJavaIdentifier(localPart), methodElement);
+ String temp = JavaUtils.xmlNameToJavaIdentifier(localPart);
+ addAttribute(doc, "name", temp , methodElement);
+ // we need first character capitalized version at times,
+ // to preserve the CamelCase name generation
+ addAttribute(doc,"firstCharCapitalizedName",
+ JavaUtils.capitalizeFirstChar(temp), methodElement);
}
-
addAttribute(doc, "originalName", localPart, methodElement);
addAttribute(doc, "namespace", axisOperation.getName().getNamespaceURI(), methodElement);
addAttribute(doc, "style", (String) getBindingPropertyFromOperation(
Modified: axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl?rev=1065907&r1=1065906&r2=1065907&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl (original)
+++ axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/CallbackHandlerTemplate.xsl Tue Feb 1 04:50:46 2011
@@ -79,7 +79,7 @@
* auto generated Axis2 call back method for <xsl:value-of select="@name"/> method
* override this method for handling normal response from <xsl:value-of select="@name"/> operation
*/
- public void receiveResult<xsl:value-of select="@name"/>(
+ public void receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(
<xsl:choose>
<xsl:when test="$outParamCount=1">
<xsl:value-of select="output/param[@location='body']/param/@type"/><xsl:text> </xsl:text>result
@@ -99,7 +99,7 @@
* auto generated Axis2 Error handler
* override this method for handling error response from <xsl:value-of select="@name"/> operation
*/
- public void receiveError<xsl:value-of select="@name"/>(java.lang.Exception e) {
+ public void receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(java.lang.Exception e) {
}
</xsl:when>
<xsl:otherwise>
Modified: axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl?rev=1065907&r1=1065906&r2=1065907&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl (original)
+++ axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceImplementationTemplate.xsl Tue Feb 1 04:50:46 2011
@@ -588,7 +588,7 @@
* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
</xsl:text></xsl:for-each>
*/
- public void start<xsl:value-of select="@name"/>(
+ public void start<xsl:value-of select="@firstCharCapitalizedName"/>(
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
@@ -741,42 +741,42 @@
org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope();
<xsl:choose>
<xsl:when test="$outputtype='byte'">
- callback.receiveResult<xsl:value-of select="@name"/>(toByte(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toByte(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='char'">
- callback.receiveResult<xsl:value-of select="@name"/>(toChar(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toChar(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='double'">
- callback.receiveResult<xsl:value-of select="@name"/>(toDouble(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toDouble(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='float'">
- callback.receiveResult<xsl:value-of select="@name"/>(toFloat(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toFloat(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='int'">
- callback.receiveResult<xsl:value-of select="@name"/>(toInt(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toInt(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='long'">
- callback.receiveResult<xsl:value-of select="@name"/>(toLong(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toLong(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='short'">
- callback.receiveResult<xsl:value-of select="@name"/>(toShort(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toShort(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:when test="$outputtype='boolean'">
- callback.receiveResult<xsl:value-of select="@name"/>(toBoolean(resultEnv.getBody().getFirstElement(),
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(toBoolean(resultEnv.getBody().getFirstElement(),
getEnvelopeNamespaces(resultEnv)));
</xsl:when>
<xsl:otherwise>
java.lang.Object object = fromOM(resultEnv.getBody().getFirstElement(),
<xsl:value-of select="$outputtype"/>.class,
getEnvelopeNamespaces(resultEnv));
- callback.receiveResult<xsl:value-of select="@name"/>(<xsl:choose>
+ callback.receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(<xsl:choose>
<xsl:when test="$outputtype=''">);</xsl:when>
<xsl:when test="$outputparamcount=1">
get<xsl:value-of select="$outputparamshorttype"/><xsl:value-of
@@ -793,7 +793,7 @@
</xsl:otherwise>
</xsl:choose>
} catch (org.apache.axis2.AxisFault e) {
- callback.receiveError<xsl:value-of select="@name"/>(e);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(e);
}
}
@@ -817,42 +817,42 @@
m.invoke(ex,new java.lang.Object[]{messageObject});
<xsl:for-each select="fault/param">
if (ex instanceof <xsl:value-of select="@name"/>){
- callback.receiveError<xsl:value-of select="$method-name"/>((<xsl:value-of select="@name"/>)ex);
+ callback.receiveError<xsl:value-of select="$method-name"/>((<xsl:value-of select="@firstCharCapitalizedName"/>)ex);
return;
}
</xsl:for-each>
- callback.receiveError<xsl:value-of select="@name"/>(new java.rmi.RemoteException(ex.getMessage(), ex));
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(new java.rmi.RemoteException(ex.getMessage(), ex));
} catch(java.lang.ClassCastException e){
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (java.lang.ClassNotFoundException e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (java.lang.NoSuchMethodException e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (java.lang.reflect.InvocationTargetException e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (java.lang.IllegalAccessException e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (java.lang.InstantiationException e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
} catch (org.apache.axis2.AxisFault e) {
// we cannot intantiate the class - throw the original Axis fault
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
}
} else {
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
}
} else {
- callback.receiveError<xsl:value-of select="@name"/>(f);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(f);
}
} else {
- callback.receiveError<xsl:value-of select="@name"/>(error);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(error);
}
}
@@ -865,7 +865,7 @@
try {
_messageContext.getTransportOut().getSender().cleanup(_messageContext);
} catch (org.apache.axis2.AxisFault axisFault) {
- callback.receiveError<xsl:value-of select="@name"/>(axisFault);
+ callback.receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(axisFault);
}
}
});
Modified: axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl?rev=1065907&r1=1065906&r2=1065907&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl (original)
+++ axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/InterfaceTemplate.xsl Tue Feb 1 04:50:46 2011
@@ -158,7 +158,7 @@
* @param <xsl:value-of select="@name"></xsl:value-of><xsl:text>
</xsl:text></xsl:for-each>
*/
- public void start<xsl:value-of select="@name"/>(
+ public void start<xsl:value-of select="@firstCharCapitalizedName"/>(
<xsl:variable name="inputcount" select="count(input/param[@location='body' and @type!=''])"/>
<xsl:variable name="inputWrappedCount" select="count(input/param[@location='body' and @type!='']/param)"/>
Modified: axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl?rev=1065907&r1=1065906&r2=1065907&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl (original)
+++ axis/axis2/java/core/trunk/modules/codegen/src/org/apache/axis2/wsdl/template/java/TestClassTemplate.xsl Tue Feb 1 04:50:46 2011
@@ -156,7 +156,7 @@
// TODO : Fill in the <xsl:value-of select="@name"/> here
</xsl:for-each>
- stub.start<xsl:value-of select="@name"/>(
+ stub.start<xsl:value-of select="@firstCharCapitalizedName"/>(
<xsl:for-each select="input/param[@type!='']">
<xsl:variable name="opname" select="@opname"/>
<xsl:variable name="paramname" select="@name"/>
@@ -178,7 +178,7 @@
);
</xsl:when>
<xsl:otherwise>
- stub.start<xsl:value-of select="@name"/>(
+ stub.start<xsl:value-of select="@firstCharCapitalizedName"/>(
new <xsl:value-of select="$tempCallbackName"/>()
);
</xsl:otherwise>
@@ -190,7 +190,7 @@
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"/>(
+ public void receiveResult<xsl:value-of select="@firstCharCapitalizedName"/>(
<xsl:choose>
<xsl:when test="$outParamCount=1">
<xsl:value-of select="output/param[@location='body']/param/@type"/><xsl:text> </xsl:text>result
@@ -205,7 +205,7 @@
}
- public void receiveError<xsl:value-of select="@name"/>(java.lang.Exception e) {
+ public void receiveError<xsl:value-of select="@firstCharCapitalizedName"/>(java.lang.Exception e) {
fail();
}