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 2006/07/23 13:11:29 UTC
svn commit: r424710 - in
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl:
codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
template/java/SkeletonInterfaceTemplate.xsl
template/java/SkeletonTemplate.xsl
Author: ajith
Date: Sun Jul 23 04:11:29 2006
New Revision: 424710
URL: http://svn.apache.org/viewvc?rev=424710&view=rev
Log:
1. Fixed the problem with exception generation mentioned in Axis2-Jira 918. Now the exception classes are generated inside the skeleton interface if the serverside interface mode is used
Modified:
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/template/java/SkeletonInterfaceTemplate.xsl
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
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=424710&r1=424709&r2=424710&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 23 04:11:29 2006
@@ -723,7 +723,7 @@
}
/**
- * @return fully qualified MR name
+ * @return fully qualified skeleton name
*/
protected String getFullyQualifiedSkeletonName() {
String packageName = codeGenConfiguration.getPackageName();
@@ -732,6 +732,14 @@
}
/**
+ * @return fully qualified skeleton interface name
+ */
+ protected String getFullyQualifiedSkeletonInterfaceName() {
+ String packageName = codeGenConfiguration.getPackageName();
+ String localPart = makeJavaClassName(axisService.getName());
+ return packageName + "." + localPart + SKELETON_INTERFACE_SUFFIX;
+ }
+ /**
* Emits the skeleton
* @throws Exception
*/
@@ -748,7 +756,7 @@
//handle faults
generateAndPopulateFaultNames();
- updateFaultPackageForSkeleton();
+ updateFaultPackageForSkeleton(codeGenConfiguration.isServerSideInterface());
if (codeGenConfiguration.isServerSideInterface()) {
//write skeletonInterface
@@ -871,13 +879,18 @@
* skeleton
* the faults are always generated as inner types
*/
- protected void updateFaultPackageForSkeleton() {
+ protected void updateFaultPackageForSkeleton(boolean isInterface) {
Iterator faultClassNameKeys = fullyQualifiedFaultClassNameMap.keySet().iterator();
while (faultClassNameKeys.hasNext()) {
Object key = faultClassNameKeys.next();
String className = (String) fullyQualifiedFaultClassNameMap.get(key);
//append the skelton name
- String fullyQualifiedSkeletonName = getFullyQualifiedSkeletonName();
+ String fullyQualifiedSkeletonName = null;
+ if (isInterface){
+ fullyQualifiedSkeletonName = getFullyQualifiedSkeletonInterfaceName();
+ }else{
+ fullyQualifiedSkeletonName = getFullyQualifiedSkeletonName();
+ }
fullyQualifiedFaultClassNameMap.put(key, fullyQualifiedSkeletonName + "."
+ className);
InstantiatableFaultClassNameMap.put(key, fullyQualifiedSkeletonName + "$"
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl?rev=424710&r1=424709&r2=424710&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonInterfaceTemplate.xsl Sun Jul 23 04:11:29 2006
@@ -48,6 +48,23 @@
<xsl:if test="position()>1">,</xsl:if><xsl:value-of select="@name"/>
</xsl:for-each>;
</xsl:for-each>
- }
+
+
+ <!-- write the classes for the exceptions if there are any present -->
+ <xsl:for-each select="fault-list/fault">
+ public static class <xsl:value-of select="@shortName"/> extends java.rmi.RemoteException{
+
+ private <xsl:value-of select="@type"/> faultMessage;
+
+ public void setFaultMessage(<xsl:value-of select="@type"/> msg){
+ faultMessage = msg;
+ }
+
+ public <xsl:value-of select="@type"/> getFaultMessage(){
+ return faultMessage;
+ }
+ }
+ </xsl:for-each>
+ }
</xsl:template>
</xsl:stylesheet>
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl?rev=424710&r1=424709&r2=424710&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/template/java/SkeletonTemplate.xsl Sun Jul 23 04:11:29 2006
@@ -57,22 +57,24 @@
}
</xsl:for-each>
+ <!-- we write the faults here only if it is not the interface mode-->
+ <xsl:if test="not(@skeletonInterfaceName)">
+ <!-- write the classes for the exceptions if there are any present -->
+ <xsl:for-each select="fault-list/fault">
+ public static class <xsl:value-of select="@shortName"/> extends java.rmi.RemoteException{
- <!-- write the classes for the exceptions if there are any present -->
- <xsl:for-each select="fault-list/fault">
- public static class <xsl:value-of select="@shortName"/> extends java.rmi.RemoteException{
+ private <xsl:value-of select="@type"/> faultMessage;
- private <xsl:value-of select="@type"/> faultMessage;
+ public void setFaultMessage(<xsl:value-of select="@type"/> msg){
+ faultMessage = msg;
+ }
- public void setFaultMessage(<xsl:value-of select="@type"/> msg){
- faultMessage = msg;
- }
-
- public <xsl:value-of select="@type"/> getFaultMessage(){
- return faultMessage;
- }
- }
- </xsl:for-each>
+ public <xsl:value-of select="@type"/> getFaultMessage(){
+ return faultMessage;
+ }
+ }
+ </xsl:for-each>
+ </xsl:if>
}
</xsl:template>
</xsl:stylesheet>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org