OSSP CVS Repository

ossp - Check-in [3916]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3916
Date: 2003-Jan-16 09:32:31 (local)
2003-Jan-16 08:32:31 (UTC)
User:ms
Branch:
Comment: Add logic to connect and syncronize with a SOAP server. Hard code usage of EasySOAP libraries into build configuration.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/aclocal.m4      1.6 -> 1.7     36 inserted, 0 deleted
ossp-pkg/as/as-gui/as_slot.cpp      1.76 -> 1.77     30 inserted, 2 deleted
ossp-pkg/as/as-gui/configure.in      1.12 -> 1.13     4 inserted, 0 deleted

ossp-pkg/as/as-gui/aclocal.m4 1.6 -> 1.7

--- aclocal.m4   2002/12/03 10:22:11     1.6
+++ aclocal.m4   2003/01/16 08:32:31     1.7
@@ -158,6 +158,42 @@
 
 
 dnl ##
+dnl ##  Test for the presence of EasySOAP
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_TEST_ESOAP
+dnl ##
+
+AC_DEFUN(AC_TEST_ESOAP,[dnl
+AC_ARG_WITH(esoapdir,dnl
+[  --with-easysoapdir=[DIR]    prefix where EasySOAP is installed], esoapdir=$withval,)
+AC_MSG_CHECKING(the EasySOAP installation path)
+
+dnl ## Ensure that we have a basic path to start searching
+if test -x "$esoapdir";
+then
+    SOAPBASE=$esoapdir
+    AC_MSG_RESULT(${SOAPBASE})
+elif test -x "${ESOAPDIR}";
+then
+    SOAPBASE="${ESOAPDIR}"
+    AC_MSG_RESULT(${SOAPBASE})
+else
+    AC_MSG_RESULT(not found)
+    AC_MSG_ERROR([Neither \$ESOAPDIR nor --with-easysoapdir=[DIR] paths exist])
+fi
+
+dnl ## Append paths of libs and headers
+LIBS="$LIBS -leasysoap -lexpat -lssl -lcrypto"
+LDFLAGS="$LDFLAGS -L${SOAPBASE}/lib -R${SOAPBASE}/lib"
+CPPFLAGS="$CPPFLAGS -I${SOAPBASE}/include"
+CXXCPP="$CXXCPP -I${SOAPBASE}/include"
+CXXFLAGS="$CXXFLAGS"
+AC_DEFINE(HAVE_ESOAP, 1, [Define to 1 if building with EasySOAP.])
+])
+
+
+dnl ##
 dnl ##  Check the Qt implementation path
 dnl ##
 dnl ##  configure.in:


ossp-pkg/as/as-gui/as_slot.cpp 1.76 -> 1.77

--- as_slot.cpp  2003/01/16 08:26:29     1.76
+++ as_slot.cpp  2003/01/16 08:32:31     1.77
@@ -36,6 +36,9 @@
 #include <qmenudata.h>
 //#include <qregexp.h>
 
+// RPC headers
+#include <easysoap/SOAP.h>
+
 // User interface
 #include "as_gui.h"             // Main classes
 #include "as_except.h"          // Exception classes
@@ -1160,8 +1163,33 @@
 //
 void Titraqform::syncSoap(void)
 {
-    Prototype Unimp;
-    Unimp.doMbox();
+    USING_EASYSOAP_NAMESPACE
+
+    try {
+        const char *pSpace    = "http://soap.europalab.com/asdb";
+        const char *pEndpoint = "http://www.europalab.com/cgi-bin/asdbserv";
+        SOAPProxy Proxy(pEndpoint);
+        SOAPMethod Logmeth("Log", pSpace);  // SOAP remote method name
+        SOAPString Clistr;                  // Outgoing parameter to marshall
+        int nCrc;                           // SOAP unmarshalled return value
+
+        // A quasi diff summary to transmit to the server
+        QString Syncthis;
+        int nLastrow = m_pMaintable->numRows() - 1;
+        Syncthis += m_pMaintable->text(nLastrow, 0);
+        for (int nIter = 1; nIter < TITRAQ_IDXTAIL; nIter++)
+            Syncthis += ' ' + m_pMaintable->text(nLastrow, nIter);
+
+        Clistr = Syncthis;                          // Build RPC parameter
+        Logmeth.AddParameter("Tuple") << Clistr;    // Prepare for marshalling
+        const SOAPResponse &Logresp = Proxy.Execute(Logmeth);
+        Logresp.GetReturnValue() >> nCrc;
+        m_pStatbar->message(trUtf8("Successful transmission, CRC returned %1").arg(nCrc));
+    }
+    catch (SOAPException& Soapex) { // Announce the exception we received
+        m_pStatbar->message(trUtf8("Caught SOAP exception: %1").arg(Soapex.What().Str()));
+        qDebug("Caught SOAP exception: %s\n", Soapex.What().Str());
+    }
 }
 
 //


ossp-pkg/as/as-gui/configure.in 1.12 -> 1.13

--- configure.in 2002/12/18 15:47:47     1.12
+++ configure.in 2003/01/16 08:32:31     1.13
@@ -73,6 +73,10 @@
                 dmalloc, dmalloc_debug, dmalloc.h,
                 [AC_DEFINE(WITH_DMALLOC, 1, [Define to 1 if building with Dmalloc])])
 
+dnl Test for the local SOAP implementation
+AC_TEST_ESOAP
+AC_SUBST(SOAPBASE)
+
 dnl Find out where the Qt implementation resides
 AC_CHECK_QT
 AC_SUBST(QTBASE)

CVSTrac 2.0.1