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 na...@apache.org on 2006/04/29 16:38:30 UTC

svn commit: r398163 - in /webservices/axis/trunk/c: include/axis/client/ src/cbindings/client/ src/engine/client/ tests/auto_build/testcases/client/cpp/ tools/org/apache/axis/tools/cbindings/ tools/org/apache/axis/tools/common/

Author: nadiramra
Date: Sat Apr 29 07:38:29 2006
New Revision: 398163

URL: http://svn.apache.org/viewcvs?rev=398163&view=rev
Log:
Add SetSecure method that accepts va_list to support C-bindings implementation.

Modified:
    webservices/axis/trunk/c/include/axis/client/Stub.hpp
    webservices/axis/trunk/c/src/cbindings/client/StubC.cpp
    webservices/axis/trunk/c/src/engine/client/Stub.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSL1Client.cpp
    webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSLClient.cpp
    webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java
    webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/cbindinggenerator.conf
    webservices/axis/trunk/c/tools/org/apache/axis/tools/common/Parameter.java

Modified: webservices/axis/trunk/c/include/axis/client/Stub.hpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/include/axis/client/Stub.hpp?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/include/axis/client/Stub.hpp (original)
+++ webservices/axis/trunk/c/include/axis/client/Stub.hpp Sat Apr 29 07:38:29 2006
@@ -27,6 +27,8 @@
 #if !defined(_STUB_H____OF_AXIS_INCLUDED_)
 #define _STUB_H____OF_AXIS_INCLUDED_
 
+#include <stdarg.h>
+
 #include <axis/client/Call.hpp>
 #include <vector>
 
@@ -577,7 +579,13 @@
     /**
      * Set SSL configuration properties.
      */
-    void AXISCALL SetSecure( char *, ...);
+    void AXISCALL SetSecure( char *pszArguments, ...);
+
+    /**
+     * Set SSL configuration properties. Added
+     * to support C bindings implementation.
+     */
+    void AXISCALL SetSecure( char *pszArguments, va_list args);
 
   protected:
   /**

Modified: webservices/axis/trunk/c/src/cbindings/client/StubC.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/cbindings/client/StubC.cpp?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/cbindings/client/StubC.cpp (original)
+++ webservices/axis/trunk/c/src/cbindings/client/StubC.cpp Sat Apr 29 07:38:29 2006
@@ -14,6 +14,8 @@
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  */
+ 
+#include <stdarg.h>
 
 #include <axis/client/Stub.hpp>
 #include <axis/AxisException.hpp>
@@ -26,7 +28,7 @@
 #include <axis/client/Stub.h>
 
 AXIS_CPP_NAMESPACE_START
-class StubC : Stub
+class StubC : public Stub
 {
 public :
     StubC(const char *ep, AXIS_PROTOCOL_TYPE pt):Stub(ep,pt) {}
@@ -746,6 +748,37 @@
     try
     {
         s->setSOAPHeadersStubC(); 
+    }
+    catch ( AxisException& e  )
+    {
+        h->_exception.setExceptionFromException(e);
+        axiscAxisInvokeExceptionHandler(e.getExceptionCode(), e.what());
+    }
+    catch ( ... )
+    {
+        h->_exception.setExceptionCode(-1);  
+        h->_exception.setMessage("Unrecognized exception thrown.");  
+        axiscAxisInvokeExceptionHandler(-1, "Unrecognized exception thrown.");
+    }
+}
+
+
+AXISC_STORAGE_CLASS_INFO 
+void axiscStubSetSecure(AXISCHANDLE stub, 
+                        char * pszArguments, 
+                        ... )
+{ 
+    AxisObjectContainer *h = (AxisObjectContainer *)stub;
+    h->_exception.resetException();
+    StubC *s = (StubC*)h->_objHandle;
+    
+    try
+    {
+        va_list args;
+    
+        va_start( args, pszArguments);    
+        s->SetSecure(pszArguments, args);
+        va_end( args);    
     }
     catch ( AxisException& e  )
     {

Modified: webservices/axis/trunk/c/src/engine/client/Stub.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/client/Stub.cpp?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/client/Stub.cpp (original)
+++ webservices/axis/trunk/c/src/engine/client/Stub.cpp Sat Apr 29 07:38:29 2006
@@ -514,30 +514,32 @@
 /*Methods for supporting SecureChannel*/
 void Stub::SetSecure( char * pszArguments, ...)
 {
-    int iArgIndex = 0;
     va_list args;
-    char *  pszArg = NULL;
     
-    va_start( args, pszArguments);
+    va_start( args, pszArguments);    
+    SetSecure(pszArguments, args);
+    va_end( args);
+}
+
+/*Methods for supporting SecureChannel*/
+void Stub::SetSecure( char * pszArguments, va_list args)
+{
+    int iArgIndex = 0;
+    char * pszArg = pszArguments;
     
-    if( (pszArg = pszArguments) != NULL)
+    if (pszArg != NULL)
     {
         do
         {
-            if( pszArg == (char *) 1)
-                m_sArguments[iArgIndex] = "true";
-            else
-                m_sArguments[iArgIndex] = pszArg;
-
+            m_sArguments[iArgIndex] = pszArg;
             iArgIndex++;
         } 
         while( (pszArg = va_arg( args, char *)) != NULL && iArgIndex < 8);
-
+        
+        // Leave for now, but remove in future. 
         if( iArgIndex == 6)
             m_sArguments[iArgIndex] = "false";
     }
-
-    va_end( args);
 }
 
 void Stub::includeSecure()

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSL1Client.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSL1Client.cpp?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSL1Client.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSL1Client.cpp Sat Apr 29 07:38:29 2006
@@ -61,7 +61,7 @@
             }
 
             sprintf(keylocation,"%s/%s",sslkeyhome,"myKeyRing.kdb");
-            ws.SetSecure(keylocation, "axxxxis4all", "AXIS", "NONE", "05", "NONE", false);
+            ws.SetSecure(keylocation, "axxxxis4all", "AXIS", "NONE", "05", "NONE", "false");
 
             iResult = ws.add(2,3);
             cout << iResult <<endl;

Modified: webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSLClient.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSLClient.cpp?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSLClient.cpp (original)
+++ webservices/axis/trunk/c/tests/auto_build/testcases/client/cpp/CalculatorDocSSLClient.cpp Sat Apr 29 07:38:29 2006
@@ -62,7 +62,7 @@
             }
 
             sprintf(keylocation,"%s/%s",sslkeyhome,"myKeyRing.kdb");
-            ws.SetSecure(keylocation, "axis4all", "AXIS", "NONE", "05", "NONE", false);
+            ws.SetSecure(keylocation, "axis4all", "AXIS", "NONE", "05", "NONE", "false");
 
             iResult = ws.add(2,3);
             cout << iResult << endl;

Modified: webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java (original)
+++ webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/CBindingGenerator.java Sat Apr 29 07:38:29 2006
@@ -335,6 +335,7 @@
             return;
         
         Parameter[] parms = sign.getParameters();
+                
         String text = new String();
 
         // Look to see if this method is overloaded by another method
@@ -412,17 +413,18 @@
         if (parms != null) 
         {
             for (int i = 0; i < parms.length; i++) 
-            {
+            { 
+                // Do not include prototypes with va_list...since these functions have
+                // probably been added in support of C binding.
+                if (parms[i].isVaListArg())
+                    return;
+                
                 if (0 != i) 
                 {
                     text += ", ";
+                    // wrap long lines at 50 chars
                     if (text.length() > 50) 
-                    { 
-                        // wrap long lines at 50 chars
-                        outputFile.write(text);
-                        outputFile.newLine();
-                        text = "\t";
-                    }
+                        text += "\n\t";
                 }
                 text += toCType(parms[i]) + " ";
                 String name = parms[i].getName();
@@ -431,7 +433,7 @@
             }
         }
         text += ");";
-                
+        
         outputFile.write(text);
         outputFile.newLine();
     }

Modified: webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/cbindinggenerator.conf
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/cbindinggenerator.conf?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/cbindinggenerator.conf (original)
+++ webservices/axis/trunk/c/tools/org/apache/axis/tools/cbindings/cbindinggenerator.conf Sat Apr 29 07:38:29 2006
@@ -32,7 +32,6 @@
 excludefile=AxisUserAPI.hpp
 excludefile=AxisUserAPI.h
 excludefile=AxisUserAPIArrays.hpp
-excludefile=AxisUserAPIArrays.h
 excludefile=Handler.hpp
 excludefile=BasicHandler.hpp
 excludefile=IHandlerSoapSerializer.hpp

Modified: webservices/axis/trunk/c/tools/org/apache/axis/tools/common/Parameter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/tools/org/apache/axis/tools/common/Parameter.java?rev=398163&r1=398162&r2=398163&view=diff
==============================================================================
--- webservices/axis/trunk/c/tools/org/apache/axis/tools/common/Parameter.java (original)
+++ webservices/axis/trunk/c/tools/org/apache/axis/tools/common/Parameter.java Sat Apr 29 07:38:29 2006
@@ -151,6 +151,21 @@
 		return 1 == type.size() && "...".equals(type.get(0));
 	}
 
+    public boolean isVaListArg() 
+    {
+        String s = null;
+        Iterator it = type.iterator();
+        while (it.hasNext()) 
+        {
+            String next = (String) it.next();
+            if ("va_list".equals(next))
+                return true;
+        }
+        
+        return false;
+    }
+    
+    
     /**
      * For two parameters to match their types must match or both be null,
      * but the parameters names don't have to match. Just because a parameter