axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r307070 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal: BeanParamWriter.java ParamCPPFileWriter.java ParmHeaderFileWriter.java
Date Fri, 07 Oct 2005 10:12:08 GMT
Author: prestonf
Date: Fri Oct  7 03:12:04 2005
New Revision: 307070

URL: http://svn.apache.org/viewcvs?rev=307070&view=rev
Log:
Part of the fix for AXISCPP-849 and AXIS-850

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=307070&r1=307069&r2=307070&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Fri Oct  7 03:12:04 2005
@@ -144,6 +144,8 @@
         {
             for (int i = 0; i < attribs.length; i++)
             {
+                attribs[i].setParamName( sanitiseAttributeName( attribs[i].getParamName()));
+
                 // FJP Nillable vv
                 if (isElementNillable(i))
                 {

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java?rev=307070&r1=307069&r2=307070&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParamCPPFileWriter.java
Fri Oct  7 03:12:04 2005
@@ -88,6 +88,8 @@
     protected abstract void writeGlobalCodes() throws WrapperFault;
     protected File getFilePath() throws WrapperFault
     {
+        classname = sanitiseClassName( classname);
+
         String targetOutputLocation =
             this.wscontext.getWrapInfo().getTargetOutputLocation();
         if (targetOutputLocation.endsWith("/"))
@@ -121,5 +123,35 @@
             e.printStackTrace();
             throw new WrapperFault(e);
         }
+    }
+    protected String sanitiseClassName( String name)
+    {
+        String sanitisedName = name;
+        String cRsrvdSymblLst = ".;-";
+
+        for( int iRSLCount = 0; iRSLCount < cRsrvdSymblLst.length(); iRSLCount++)
+        {
+            sanitisedName.replaceAll( cRsrvdSymblLst.substring( iRSLCount, iRSLCount), "_");
+        }
+        
+        return sanitisedName;
+    }
+
+    protected String sanitiseAttributeName( String name)
+    {
+        String sanitisedName = name;
+        String cRsrvdSymblLst = ".;-";
+
+        for( int iRSLCount = 0; iRSLCount < cRsrvdSymblLst.length(); iRSLCount++)
+        {
+            sanitisedName.replaceAll( cRsrvdSymblLst.substring( iRSLCount, iRSLCount), "_");
+        }
+        
+        if( classname.equals( sanitisedName))
+        {
+            sanitisedName += "_";
+        }
+        
+        return sanitisedName;
     }
 }

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java?rev=307070&r1=307069&r2=307070&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/ParmHeaderFileWriter.java
Fri Oct  7 03:12:04 2005
@@ -68,6 +68,9 @@
             } else
             {
                 writePreprocessorStatements();
+
+                classname = sanitiseClassName( classname);
+                
                 this.writer.write("class STORAGE_CLASS_INFO " + classname);
                 if (this.type.isFault())
                     this.writer.write(" : public SoapFaultException");
@@ -255,6 +258,8 @@
             writer.write("public:\n");
             for (int i = 0; i < attribs.length; i++)
             {
+                attribs[i].setParamName( sanitiseAttributeName( attribs[i].getParamName()));
+                
 				// FJP Nillable vv
 				if (isElementNillable(i)) {
 					if(attribs[i].isAnyType()){
@@ -267,7 +272,6 @@
 								+ ";\n");
 						
 					}
-						
 					else{
 					writer.write("\t"
 								 + getCorrectParmNameConsideringArraysAndComplexTypes(attribs[i])
@@ -565,4 +569,35 @@
         return bNillable;
     }
     //	 FJP Nillable ^^
+
+    protected String sanitiseClassName( String name)
+    {
+        String sanitisedName = name;
+        String cRsrvdSymblLst = ".;-";
+
+        for( int iRSLCount = 0; iRSLCount < cRsrvdSymblLst.length(); iRSLCount++)
+        {
+            sanitisedName.replaceAll( cRsrvdSymblLst.substring( iRSLCount, iRSLCount), "_");
+        }
+        
+        return sanitisedName;
+    }
+
+    protected String sanitiseAttributeName( String name)
+    {
+        String sanitisedName = name;
+        String cRsrvdSymblLst = ".;-";
+
+        for( int iRSLCount = 0; iRSLCount < cRsrvdSymblLst.length(); iRSLCount++)
+        {
+            sanitisedName.replaceAll( cRsrvdSymblLst.substring( iRSLCount, iRSLCount), "_");
+        }
+        
+        if( classname.equals( sanitisedName))
+        {
+            sanitisedName += "_";
+        }
+        
+        return sanitisedName;
+    }
 }



Mime
View raw message