axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nadira...@apache.org
Subject svn commit: r713841 [5/5] - in /webservices/axis/trunk/c/src: cbindings/ common/ engine/ engine/client/ engine/server/ platforms/aix/ platforms/hp-ux/ platforms/os400/ platforms/unix/ platforms/windows/ server/simple_axis_server/ soap/ transport/ trans...
Date Thu, 13 Nov 2008 22:13:25 GMT
Modified: webservices/axis/trunk/c/src/transport/SOAPTransport.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/SOAPTransport.h?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/SOAPTransport.h (original)
+++ webservices/axis/trunk/c/src/transport/SOAPTransport.h Thu Nov 13 14:13:23 2008
@@ -532,6 +532,13 @@
     */
     virtual bool isThereResponseData() {return false;}
    
+    /**
+      * Enable trace.
+      *  @param logFilePath  path to log file. 
+      *  @param filters      log filters.  See common/AxisTrace.h.
+      */
+      virtual void enableTrace(const char* logFilePath, const char *filters) { }
+      
   /**
     * Sets the username to be used for basic authentication
     */

Modified: webservices/axis/trunk/c/src/transport/axis3/ChannelFactory.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/ChannelFactory.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/ChannelFactory.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/ChannelFactory.cpp Thu Nov 13 14:13:23 2008
@@ -60,6 +60,8 @@
 IChannel * ChannelFactory::
 LoadChannelLibrary( g_ChannelType eChannelType, const char * pcLibraryName)
 {
+	logEntryEngine("ChannelFactory::LoadChannelLibrary")
+
     DLHandler    sLibHandler;
     IChannel *    pChannel = NULL;
     int            iLibCount = (int) eChannelType;
@@ -68,6 +70,8 @@
     if( m_pLibName[iLibCount] == NULL ||
         strcmp( pcLibraryName, m_pLibName[iLibCount]) != 0)
     {
+        logDebugArg1("Loading transport %s", pcLibraryName)
+
         sLibHandler = PLATFORM_LOADLIB( pcLibraryName);
 
         if( !sLibHandler)
@@ -76,6 +80,8 @@
             string sFullMessage = "Failed to load transport channel library " +  
                                   string(pcLibraryName) + ". " + PLATFORM_LOADLIB_ERROR;
 
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_CHANNEL_FAILED", sFullMessage.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, sFullMessage.c_str());
         }
         else
@@ -98,25 +104,18 @@
 
                 if( eChannelType == UnsecureChannel)
                 {
+                    logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_CHANNEL_FAILED", sFullMessage.c_str())
+
                     throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, sFullMessage.c_str());
                 }
                 else
                 {
+                    logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_SSLCHANNEL_FAILED", sFullMessage.c_str())
+
                     throw HTTPTransportException( SERVER_TRANSPORT_LOADING_SSLCHANNEL_FAILED, sFullMessage.c_str());
                 }
             }
 
-#ifdef ENABLE_AXISTRACE
-// Load function to do lib level inits
-            void (*initializeLibrary) (AxisTraceEntrypoints*);
-            initializeLibrary = (void (*)(AxisTraceEntrypoints*))PLATFORM_GETPROCADDR(sLibHandler, "initializeLibrary");
-
-            if( initializeLibrary)
-            {
-                (*initializeLibrary) (AxisTrace::getTraceEntrypoints());
-            }
-#endif
-
             // Additional code added to that when the user wants to load a different
             // library from that which is already loaded, it will now allow the change.
             UnLoadChannelLibrary(eChannelType);
@@ -132,18 +131,25 @@
             {
                 sCreate( &pChannel);
                 m_pChannel[iLibCount] = pChannel;
+                
+                if (AxisTrace::isTransportLoggingEnabled())
+                	pChannel->enableTrace(AxisTrace::getLogFilePath().c_str(), AxisTrace::getLogFilter().c_str());
             }
         }
     }
     else
         pChannel = m_pChannel[iLibCount];
 
+    logExitWithPointer(pChannel)
+    
     return pChannel;
 }
 
 bool ChannelFactory::
 UnLoadChannelLibrary( g_ChannelType eChannelType)
 {
+	logEntryEngine("ChannelFactory::UnLoadChannelLibrary")
+
     bool    bSuccess = false;
     int        iLibIndex = (int) eChannelType;
 
@@ -182,6 +188,8 @@
         bSuccess = true;
     }
 
+    logExitWithBoolean(bSuccess)
+    
     return bSuccess;
 }
 
@@ -195,6 +203,8 @@
 void ChannelFactory::
 preloadChannel(g_ChannelType type, const char *pcLibraryName)
 {
+	logEntryEngine("ChannelFactory::preloadChannel")
+
     int iLibCount = (int)type;
     ChannelLibrary *pCh = new ChannelLibrary();
 
@@ -207,6 +217,8 @@
         
         delete pCh;
 
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_CHANNEL_FAILED", sFullMessage.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, sFullMessage.c_str());
     }
 
@@ -227,42 +239,49 @@
 
         if( type == UnsecureChannel)
         {
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_CHANNEL_FAILED", sFullMessage.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_LOADING_CHANNEL_FAILED, sFullMessage.c_str());
         }
         else
         {
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_LOADING_SSLCHANNEL_FAILED", sFullMessage.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_LOADING_SSLCHANNEL_FAILED, sFullMessage.c_str());
         }
     }
 
-#ifdef ENABLE_AXISTRACE
-    // Load function to do lib level inits
-    void (*initializeLibrary) (AxisTraceEntrypoints*);
-    initializeLibrary = (void (*)(AxisTraceEntrypoints*))PLATFORM_GETPROCADDR(pCh->m_Library, "initializeLibrary");
-    if( initializeLibrary)
-    {
-        (*initializeLibrary) (AxisTrace::getTraceEntrypoints());
-    }
-#endif
     m_ChannelLibrary[iLibCount] = pCh;
+    
+    logExit()
 }
 
 IChannel *ChannelFactory::
 createChannel(g_ChannelType type) 
 {
+	logEntryEngine("ChannelFactory::createChannel")
+
     int iLibCount = (int)type;
     IChannel *pChannel = NULL;
     if (m_ChannelLibrary[iLibCount])
     {
         m_ChannelLibrary[iLibCount]->m_Create(&pChannel);
         m_pChannel[iLibCount] = pChannel;
+        
+        if (AxisTrace::isTransportLoggingEnabled())
+        	pChannel->enableTrace(AxisTrace::getLogFilePath().c_str(), AxisTrace::getLogFilter().c_str());
     }
+    
+    logExitWithPointer(pChannel)
+
     return pChannel;
 }
 
 void ChannelFactory::
 unloadChannels()
 {
+	logEntryEngine("ChannelFactory::unloadChannels")
+
     for (int i=0; i<(int)MaxChannelCount; i++) 
     {
         if (m_ChannelLibrary[i])
@@ -272,6 +291,8 @@
             m_ChannelLibrary[i] = NULL;
         }
     }
+	
+    logExit()
 }
 
 AXIS_CPP_NAMESPACE_END

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.cpp Thu Nov 13 14:13:23 2008
@@ -29,6 +29,8 @@
 HTTPChannel::
 HTTPChannel()
 {
+    logEntryTransport("HTTPChannel::HTTPChannel")
+
     m_LastError = "No Errors";
 
     m_Sock = INVALID_SOCKET;
@@ -47,8 +49,12 @@
 
     if( !StartSockets())
     {
+        logThrowException("HTTPTransportException - SERVER_TRANSPORT_CHANNEL_INIT_ERROR")
+
         throw HTTPTransportException( SERVER_TRANSPORT_CHANNEL_INIT_ERROR);
     }
+    
+    logExit()
 }
 
 /**
@@ -61,8 +67,12 @@
 HTTPChannel::
 ~HTTPChannel()
 {
+	logEntryTransport("HTTPChannel::~HTTPChannel")
+
     CloseChannel();
     StopSockets();
+    
+    logExit()
 }
 
 /**
@@ -90,7 +100,11 @@
 void HTTPChannel::
 setURL( const char * cpURL)
 {
+	logEntryTransport("HTTPChannel::setURL")
+
     m_URL.setURL( cpURL);
+	
+	logExit()
 }
 
 /**
@@ -122,6 +136,8 @@
 bool HTTPChannel::
 open() throw (HTTPTransportException&)
 {
+	logEntryTransport("HTTPChannel::open")
+
     bool    bSuccess = (bool) AXIS_FAIL;
 
     CloseChannel();
@@ -130,9 +146,13 @@
 
     if( (bSuccess = OpenChannel()) != AXIS_SUCCESS)
     {
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_SOCKET_CONNECT_ERROR", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_SOCKET_CONNECT_ERROR, m_LastError.c_str());
     }
 
+    logExit()
+    
     return bSuccess;
 }
 
@@ -148,7 +168,12 @@
 bool HTTPChannel::
 close()
 {
+	logEntryTransport("HTTPChannel::close")
+
     CloseChannel();
+	
+	logExit()
+	
     return AXIS_SUCCESS;
 }
 
@@ -184,9 +209,14 @@
 int HTTPChannel::
 readBytes(char *buf, int bufLen)
 {
+	logEntryTransport("HTTPChannel::readBytes")
+
     if (INVALID_SOCKET == m_Sock)
     {
         m_LastError = "Unable to perform read operation.";
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_INVALID_SOCKET", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_INVALID_SOCKET, m_LastError.c_str());
     }
 
@@ -201,12 +231,17 @@
         // Handle timeout outcome
         if( iTimeoutStatus < 0)
         {
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_TIMEOUT_EXCEPTION", m_LastError.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_TIMEOUT_EXCEPTION, m_LastError.c_str());
         }
     
         if( iTimeoutStatus == 0)
         {
             m_LastError = "Read operation timed-out while waiting for data.";
+            
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_TIMEOUT_EXPIRED", m_LastError.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_TIMEOUT_EXPIRED, m_LastError.c_str() );
         }
     }
@@ -221,16 +256,24 @@
 
         if( !bNoExceptionOnForceClose)
         {
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_INPUT_STREAMING_ERROR", m_LastError.c_str())
+
             throw HTTPTransportException( SERVER_TRANSPORT_INPUT_STREAMING_ERROR, m_LastError.c_str());
         }
     }
     else if ( 0 == nByteRecv )
     {
+        logDebug("Read-side of socket has been closed.")
+
         // read-side of socket is closed.
     }
     else if( nByteRecv)
         buf[nByteRecv] = '\0';
 
+    logDebugBuffer(buf, nByteRecv)
+
+	logExitWithInteger(nByteRecv)
+
     return nByteRecv;
 }
 
@@ -248,9 +291,16 @@
 int HTTPChannel::
 writeBytes(const char *buf, int numBytes)
 {
+	logEntryTransport("HTTPChannel::writeBytes")
+
+    logDebugBuffer(buf, numBytes)
+
     if( INVALID_SOCKET == m_Sock)
     {
         m_LastError = "No valid socket to perform write operation.";
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_INVALID_SOCKET", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_INVALID_SOCKET, m_LastError.c_str());
     }
 
@@ -268,9 +318,13 @@
         // Close the channel and throw an exception.
         CloseChannel();
 
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_OUTPUT_STREAMING_ERROR, m_LastError.c_str());
     }
 
+	logExitWithInteger(nByteSent)
+
     return nByteSent;
 }
 
@@ -285,7 +339,11 @@
 void HTTPChannel::
 setTimeout( long lSeconds)
 {
+	logEntryTransport("HTTPChannel::setTimeout")
+
     m_lTimeoutSeconds = lSeconds;
+	
+	logExit()
 }
 
 /**
@@ -368,9 +426,13 @@
 void HTTPChannel::
 setProxy( const char * pcProxyHost, unsigned int uiProxyPort)
 {
+	logEntryTransport("HTTPChannel::setProxy")
+
     m_strProxyHost = pcProxyHost;
     m_uiProxyPort = uiProxyPort;
     m_bUseProxy = true;
+    
+    logExit()
 }
 
 // +--------------------------------------------------------------------------+
@@ -390,6 +452,8 @@
 bool HTTPChannel::
 OpenChannel()
 {
+	logEntryTransport("HTTPChannel::OpenChannel")
+
     // This method is common to all channel implementations
     bool    bSuccess = (bool) AXIS_FAIL;
 
@@ -422,6 +486,9 @@
     if( getaddrinfo( pszHost, szPort, &aiHints, &paiAddrInfo0))
     {
         m_LastError = "Unable to get address information.";
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_SOCKET_CREATE_ERROR", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_SOCKET_CREATE_ERROR, m_LastError.c_str());
     }
 
@@ -449,6 +516,8 @@
             
             m_LastError = fullMessage;
 
+            logThrowExceptionWithData("HTTPTransportException - CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED", m_LastError.c_str())
+
             throw HTTPTransportException( CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED, m_LastError.c_str());
         }
 
@@ -462,6 +531,9 @@
     {
         ReportError();        
         CloseChannel();
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_SOCKET_CREATE_ERROR", m_LastError.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_SOCKET_CREATE_ERROR, m_LastError.c_str());
     }
 
@@ -471,6 +543,9 @@
     if( (m_Sock = socket( PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
     {
         ReportError();
+        
+    	logExitWithBoolean(bSuccess)
+
         return bSuccess;
     }
 
@@ -487,6 +562,9 @@
     {
         ReportError();        
         CloseChannel();
+        
+    	logExitWithBoolean(bSuccess)
+
         return bSuccess;
     }
 
@@ -548,6 +626,8 @@
 
         m_LastError = fullMessage;
 
+    	logExitWithBoolean(bSuccess)
+
         return bSuccess;
     }
     else
@@ -568,6 +648,8 @@
     int one = 1;
     setsockopt( m_Sock, IPPROTO_TCP, TCP_NODELAY, (char *) &one, sizeof( int));
 
+	logExitWithBoolean(bSuccess)
+
     return bSuccess;
 }
 
@@ -583,6 +665,8 @@
 void HTTPChannel::
 CloseChannel()
 {
+	logEntryTransport("HTTPChannel::CloseChannel")
+
     if( INVALID_SOCKET != m_Sock)
     {
 #ifdef WIN32
@@ -592,6 +676,8 @@
 #endif
         m_Sock = INVALID_SOCKET;
     }
+	
+	logExit()
 }
 
 /**
@@ -680,6 +766,8 @@
 int HTTPChannel::
 applyTimeout()
 {
+	logEntryTransport("HTTPChannel::applyTimeout")
+
     fd_set          set;
     struct timeval  timeout;
 
@@ -697,6 +785,8 @@
     if (rc < 0)
         ReportError();
         
+	logExitWithReturnCode(rc)
+
     return rc;
 }
 
@@ -714,3 +804,10 @@
 {
     bNoExceptionOnForceClose = bNoExceptionOnForceClose_Update;
 }
+
+void HTTPChannel::
+enableTrace(const char* logFilePath, const char *filters)
+{
+	AxisTrace::setLogFilter(filters);
+	AxisTrace::startTrace(logFilePath, false);
+}
\ No newline at end of file

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannel.hpp Thu Nov 13 14:13:23 2008
@@ -82,6 +82,8 @@
     void				setProxy( const char * pcProxyHost, unsigned int uiProxyPort);
 	bool		        reopenRequired() { return (INVALID_SOCKET == m_Sock); }
 	void				closeQuietly( bool bNoExceptionOnForceClose);
+    void                enableTrace(const char* logFilePath, const char *filters);
+
 
 protected:
 	bool				OpenChannel();

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannelInstantiator.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannelInstantiator.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannelInstantiator.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPChannel/HTTPChannelInstantiator.cpp Thu Nov 13 14:13:23 2008
@@ -19,10 +19,6 @@
 // !!! Must be first thing in file !!!
 #include "../../../platforms/PlatformAutoSense.hpp"
 
-#ifndef AXISTRACE_LIBRARY_MAINENTRYPOINT
-#define AXISTRACE_LIBRARY_MAINENTRYPOINT
-#endif
-
 #include "../../../common/AxisTrace.h"
 
 #include "HTTPChannel.hpp"
@@ -63,12 +59,9 @@
 
     /*  initializeLibrary() Is a C interface.
      */
-    STORAGE_CLASS_INFO void initializeLibrary (AxisTraceEntrypoints* ep)
+    STORAGE_CLASS_INFO void initializeLibrary (void)
     {
-        // Do init actions
-#ifdef ENABLE_AXISTRACE
-        AxisTrace::setTraceEntrypoints(ep);
-#endif
+    	// Do init actions
     }
 
     /*  uninitializeLibrary() Is a C interface.

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp Thu Nov 13 14:13:23 2008
@@ -23,10 +23,6 @@
 // !!! Must be first thing in file !!!
 #include "../../../platforms/PlatformAutoSense.hpp"
 
-#ifndef AXISTRACE_LIBRARY_MAINENTRYPOINT
-#define AXISTRACE_LIBRARY_MAINENTRYPOINT
-#endif
-
 #include "../../../common/AxisTrace.h"
 
 #include "HTTPSSLChannel.hpp"
@@ -67,12 +63,9 @@
 
     /*  initializeLibrary() Is a C interface.
      */
-    STORAGE_CLASS_INFO void initializeLibrary (AxisTraceEntrypoints* ep)
+    STORAGE_CLASS_INFO void initializeLibrary (void)
     {
         // Do init actions
-#ifdef ENABLE_AXISTRACE
-        AxisTrace::setTraceEntrypoints(ep);
-#endif
     }
 
     /*  uninitializeLibrary() Is a C interface.

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.cpp Thu Nov 13 14:13:23 2008
@@ -71,7 +71,8 @@
 /*
  * HTTPTransport constuctor
  */
-HTTPTransport::HTTPTransport ():
+HTTPTransport::
+HTTPTransport ():
 m_bReopenConnection (false),
 m_strHTTPProtocol ("HTTP/1.1"),
 m_strHTTPMethod ("POST"),
@@ -80,6 +81,8 @@
 m_bUseProxy (false),
 m_bMaintainSession (false)
 {
+	logEntryTransport("HTTPTransport::HTTPTransport")
+
     m_pcEndpointUri = NULL;
     m_pReleaseBufferCallback = 0;
     m_eProtocolType = APTHTTP1_1;
@@ -104,6 +107,8 @@
     m_pSecureChannel = m_pChannelFactory->createChannel(SecureChannel);
 
     resetInputStateMachine();
+    
+    logExit()
 }
 
 /*
@@ -112,14 +117,20 @@
 HTTPTransport::
 ~HTTPTransport()
 {
+	logEntryTransport("HTTPTransport::~HTTPTransport")
+
     delete [] m_pcEndpointUri;
     delete m_pChannelFactory; // should also destroy channels
     delete [] m_pszRxBuffer;
+    
+    logExit()
 }
 
 void HTTPTransport::
 resetInputStateMachine()
 {
+	logEntryTransport("HTTPTransport::resetInputStateMachine")
+
     m_GetBytesState = eWaitingForHTTPHeader;
     
     m_strReceived.erase();
@@ -128,6 +139,8 @@
     m_iNextChunkedDataSize = 0;
     m_iContentLength = 0;
     m_bMimeTrue = false;  
+    
+    logExit()
 }
 
 /*
@@ -141,9 +154,17 @@
 void HTTPTransport::
 setEndpointUri( const char * pcEndpointUri) throw (HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::setEndpointUri")
+
+    logDebugArg1("Endpoint is %s", pcEndpointUri ? pcEndpointUri : "NULL")
+
     // if URI not valid, return
     if (!pcEndpointUri || strlen(pcEndpointUri) < strlen("http://") )
-        return;                                                  
+    {
+    	logExit()
+    	
+        return;  
+    }
 
     // Does the new URI equal the existing channel URI?
     // If there is a new URI, then connection will be closed and a secure or unsecure channel 
@@ -169,7 +190,11 @@
             }
 
             if( !m_bChannelSecure)
+            {
+                logThrowException("HTTPTransportException - CLIENT_TRANSPORT_HAS_NO_SECURE_TRANSPORT_LAYER")
+
                 throw HTTPTransportException( CLIENT_TRANSPORT_HAS_NO_SECURE_TRANSPORT_LAYER);
+            }
         }
         else if (m_bChannelSecure)
         {
@@ -182,7 +207,11 @@
             }
 
             if( m_bChannelSecure)
+            {
+                logThrowException("HTTPTransportException - CLIENT_TRANSPORT_HAS_NO_UNSECURE_TRANSPORT_LAYER")
+
                 throw HTTPTransportException( CLIENT_TRANSPORT_HAS_NO_UNSECURE_TRANSPORT_LAYER);
+            }
         }
     }
 
@@ -191,6 +220,8 @@
     // the channel is sure to have the correct timeout value next time the channel is read.
     if( m_pActiveChannel != NULL)
         m_pActiveChannel->setTimeout( m_lChannelTimeout);
+    
+    logExit()
 }
 
 /*
@@ -200,17 +231,24 @@
 int HTTPTransport::
 openConnection()
 {
+	logEntryTransport("HTTPTransport::openConnection")
+
     // If connection not valid or reopen required, open a connection to server.
     if (m_pActiveChannel->reopenRequired() || m_bReopenConnection)
     {
         closeConnection(true);
         if( m_pActiveChannel->open() != AXIS_SUCCESS)
         {
+            logThrowExceptionWithData("HTTPTransportException - CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED", 
+            		                  m_pActiveChannel->GetLastErrorMsg().c_str())
+
             throw HTTPTransportException( CLIENT_TRANSPORT_OPEN_CONNECTION_FAILED,
                                           m_pActiveChannel->GetLastErrorMsg().c_str());
         }
     }
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+	
     return AXIS_SUCCESS;
 }
 
@@ -220,6 +258,8 @@
 void HTTPTransport::
 closeConnection(bool forceClose)
 {
+	logEntryTransport("HTTPTransport::closeConnection")
+
     resetInputStateMachine();
     
     // We will close the connection if forced close, or if "Connection: close" 
@@ -229,6 +269,8 @@
         m_bReopenConnection = false;
         m_pActiveChannel->close();
     }
+    
+    logExit()
 }
 
 /*
@@ -244,6 +286,8 @@
 AXIS_TRANSPORT_STATUS HTTPTransport::
 flushOutput() throw (AxisException, HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::flushOutput")
+
     char *utf8Buf = NULL; // buffer for ebcdic/utf8 conversions.
 
     // In preperation for sending the message, set Content-Length HTTP header.
@@ -256,7 +300,7 @@
     {
         // Generate HTTP header string
         generateHTTPHeaders ();
-        
+                
         // Send HTTP headers and body
 #ifndef __OS400__
         m_pActiveChannel->writeBytes(m_strHeaderBytesToSend.c_str(), m_strHeaderBytesToSend.length());
@@ -280,6 +324,9 @@
             free(utf8Buf);
         m_strBytesToSend = "";
         m_strHeaderBytesToSend = "";
+        
+        logRethrowException()
+        
         throw;
     }
 
@@ -291,6 +338,8 @@
     m_vResponseHTTPHeaders.clear();
     // TODO: Possible memory leak here - does the clear op clean out the memory too?
 
+    logExit()
+    
     return TRANSPORT_FINISHED;
 }
 
@@ -303,6 +352,8 @@
 const char * HTTPTransport::
 generateHTTPHeaders()
 {
+	logEntryTransport("HTTPTransport::generateHTTPHeaders")
+
     URL & url = m_pActiveChannel->getURLObject();
     unsigned short uiPort;
     char buff[32];
@@ -421,6 +472,8 @@
 
     m_strHeaderBytesToSend += "\r\n";
 
+    logExit()
+    
     return m_strHeaderBytesToSend.c_str ();
 }
 
@@ -445,7 +498,14 @@
 void HTTPTransport::
 setHTTPMethod( const char *cpMethod)
 {
-    m_strHTTPMethod = std::string( cpMethod);
+	logEntryTransport("HTTPTransport::setHTTPMethod")
+	
+    logDebugArg1("HTTP method is %s", cpMethod ? cpMethod : "NULL")
+
+    if (cpMethod)
+        m_strHTTPMethod = std::string( cpMethod);
+	
+	logExit()
 }
 
 /* HTTPTransport::sendBytes( SendBuffer, BufferId) Is a public method that
@@ -470,10 +530,16 @@
 bool HTTPTransport::
 isThereResponseData()
 {
+	logEntryTransport("HTTPTransport::isThereResponseData")
+
     // We do not want to consume any SOAP data, just find out if there is any data.
     int bufLen = 0;
     getBytes(NULL, &bufLen);
-    return (m_GetBytesState != eWaitingForHTTPHeader || m_iBytesLeft != 0);
+    bool returnValue = (m_GetBytesState != eWaitingForHTTPHeader || m_iBytesLeft != 0);
+    
+    logExitWithBoolean(returnValue)
+    
+    return returnValue;
 }
 
 /* HTTPTransport::getBytes( ReceiveBuffer, Size) Is a public method that will
@@ -490,6 +556,8 @@
 AXIS_TRANSPORT_STATUS HTTPTransport::
 getBytes( char * pcBuffer, int * piSize) throw (AxisException, HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::getBytes")
+
     // The method getBytes has three distinct states.  These are defined as
     // follows:-
     //   eWaitingForHTTPHeader        - Waiting for HTTP response header. Initiate processing
@@ -540,7 +608,9 @@
     }
     else
         *piSize = 0;
-
+    
+    logExit()
+    
     // Set transport status 
     return (m_iBytesLeft > 0 || (m_GetBytesState != eWaitingForHTTPHeader)) ? 
                 TRANSPORT_IN_PROGRESS : TRANSPORT_FINISHED;
@@ -553,6 +623,8 @@
 int HTTPTransport::
 getBytes_MessageHasContentLength(char * pcBuffer, int * piSize)
 {
+	logEntryTransport("HTTPTransport::getBytes_MessageHasContentLength")
+
     // If we do not have data to give back, read more.  
     if (m_iContentLength > 0 && m_iBytesLeft == 0)
     {
@@ -576,6 +648,8 @@
     if (0 == m_iContentLength)
         m_GetBytesState = eWaitingForHTTPHeader;
         
+    logExitWithInteger(m_iBytesLeft)
+
     // Return number of bytes that can be copied
     return m_iBytesLeft;
 }
@@ -589,6 +663,8 @@
 int HTTPTransport::
 getBytes_MessageIsNotChunked(char * pcBuffer, int * piSize)
 {
+	logEntryTransport("HTTPTransport::getBytes_MessageIsNotChunked")
+
     // Keep reading until the connection is closed by the server.
     getNextDataPacket( "Expecting server connection to close.");
 
@@ -599,6 +675,8 @@
         m_iBytesLeft = m_strReceived.length();
     }
     
+    logExitWithInteger(m_iBytesLeft)
+
     // Return number of bytes that can be copied
     return m_iBytesLeft;
 }
@@ -636,6 +714,8 @@
 int HTTPTransport::
 getBytes_MessageIsChunked(char * pcBuffer, int * piSize)
 {
+	logEntryTransport("HTTPTransport::getBytes_MessageIsChunked")
+
     // We only read the next chunk if the chunk we have has been consumed. 
     if (m_iChunkedDataLeftToConsume == 0)
     {
@@ -711,6 +791,8 @@
         m_iChunkedDataLeftToConsume -= *piSize;
     }
     
+    logExitWithInteger(iDataToCpyLen)
+
     return iDataToCpyLen;
 }
 
@@ -722,6 +804,8 @@
 int HTTPTransport::
 getChunkSize(string::size_type pos)
 {
+	logEntryTransport("HTTPTransport::getChunkSize")
+
     string::size_type iEndOfChunkSize;
     string::size_type iEndOfChunkLine;
     
@@ -757,6 +841,9 @@
         
         PLATFORM_ASCTOSTR(chunkSizeLine.c_str());
         string errorMessage = string("Chunk size (") + chunkSizeLine + string(") not valid.");
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_HTTP_EXCEPTION", errorMessage.c_str())
+               		                  
         throw HTTPTransportException(SERVER_TRANSPORT_HTTP_EXCEPTION, errorMessage.c_str());        
     }
 
@@ -777,6 +864,8 @@
         m_strReceived.erase(0, iEndOfChunkLine + 2); // "+2" for CRLF
     m_iBytesLeft  = m_strReceived.length();   
     
+    logExitWithInteger(chunkSize)
+ 
     // return chunksize
     return chunkSize;
 }
@@ -793,6 +882,8 @@
 int HTTPTransport::
 setTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE type, const char *value) throw (HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::setTransportProperty")
+
     const char *key = NULL;
     int   iSuccess = AXIS_SUCCESS;
 
@@ -863,6 +954,8 @@
     if( key)
         setTransportProperty( key, value);
 
+    logExitWithReturnCode(iSuccess)
+    
     return iSuccess;
 }
 
@@ -878,34 +971,45 @@
 int HTTPTransport::
 setTransportProperty( const char *pcKey, const char *pcValue) throw (HTTPTransportException)
 {
-    if( !pcKey || !pcValue)   
-        return AXIS_SUCCESS;
+	logEntryTransport("HTTPTransport::setTransportProperty")
 
-    bool b_KeyFound = false;
+    int   iSuccess = AXIS_SUCCESS;
 
-    // Check for well known headers that we add on in every iteration
-    if (strcmp( pcKey, "SOAPAction") == 0 
-            || strcmp( pcKey, "Content-Length") == 0
-            || strcmp( pcKey, "Connection") == 0)
+    if( pcKey && pcValue) 
     {
-        std::string strKeyToFind = std::string( pcKey);
-
-        for (unsigned int i = 0; i < m_vHTTPHeaders.size(); i++)
-            if (m_vHTTPHeaders[i].first == strKeyToFind)
-            {
-                m_vHTTPHeaders[i].second = (string) pcValue;
-                b_KeyFound = true;
+        logDebugArg2("Transport property to set: %s=%s", pcKey, pcValue)
 
-                break;
-            }
+	    bool b_KeyFound = false;
+	
+	    // Check for well known headers that we add on in every iteration
+	    if (strcmp( pcKey, "SOAPAction") == 0 
+	            || strcmp( pcKey, "Content-Length") == 0
+	            || strcmp( pcKey, "Connection") == 0)
+	    {
+	        std::string strKeyToFind = std::string( pcKey);
+	
+	        for (unsigned int i = 0; i < m_vHTTPHeaders.size(); i++)
+	            if (m_vHTTPHeaders[i].first == strKeyToFind)
+	            {
+	                m_vHTTPHeaders[i].second = (string) pcValue;
+	                b_KeyFound = true;
+	
+	                break;
+	            }
+	    }
+	    else if(strcmp(pcKey, "Cookie")==0)
+	    {
+	    	iSuccess = addCookie(pcValue);
+	    	b_KeyFound = true;
+	    }
+	    
+	    if( !b_KeyFound)
+	        m_vHTTPHeaders.push_back( std::make_pair( (string) pcKey, (string) pcValue));
     }
-    else if(strcmp(pcKey, "Cookie")==0)
-        return addCookie(pcValue);
-
-    if( !b_KeyFound)
-        m_vHTTPHeaders.push_back( std::make_pair( (string) pcKey, (string) pcValue));
     
-    return AXIS_SUCCESS;
+    logExitWithReturnCode(iSuccess)
+
+    return iSuccess;
 }
 
 /* HTTPTransport::getTransportProperty( Type) Is a public method that will
@@ -921,6 +1025,8 @@
 const char * HTTPTransport::
 getTransportProperty( AXIS_TRANSPORT_INFORMATION_TYPE eType) throw (HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::getTransportProperty")
+
     const char *pszPropValue = NULL;
 
     switch( eType)
@@ -970,6 +1076,8 @@
         }
     }
 
+    logExitWithString(pszPropValue)
+
     return pszPropValue;
 }
 
@@ -1066,10 +1174,16 @@
 void HTTPTransport::
 setProxy( const char *pcProxyHost, unsigned int uiProxyPort)
 {
+	logEntryTransport("HTTPTransport::setProxy")
+
+    logDebugArg2("Proxy host is %s, proxy port is %d", pcProxyHost ? pcProxyHost : "NULL", uiProxyPort)
+
     m_pActiveChannel->setProxy(pcProxyHost,uiProxyPort);
     m_strProxyHost = pcProxyHost;
     m_uiProxyPort = uiProxyPort;
     m_bUseProxy = true;
+    
+    logExit()
 }
 
 /* HTTPTransport::setTimeout( Timeout) Is a public method for setting the
@@ -1081,10 +1195,14 @@
 void HTTPTransport::
 setTimeout( long lSeconds)
 {
+	logEntryTransport("HTTPTransport::setTimeout")
+
     if( m_pActiveChannel != NULL)
         m_pActiveChannel->setTimeout( lSeconds);
 
     m_lChannelTimeout = lSeconds;
+    
+    logExit()
 }
 
 /* HTTPTransport::getHTTPProtocol() Is a public method for retrieving the
@@ -1159,6 +1277,8 @@
 void HTTPTransport::
 processHTTPHeader()
 {
+	logEntryTransport("HTTPTransport::processHTTPHeader")
+
     // Prior to calling this method, m_strResponseHTTPHeaders should have been 
     // set to the HTTP header in the response, which is in ascii.  For EBCDIC 
     // systems, we need to convert the data from ASCII to EBCDIC.
@@ -1179,6 +1299,8 @@
     
     if( (iPosition = m_strResponseHTTPHeaders.find( "HTTP" )) == std::string::npos)
     {
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_UNKNOWN_HTTP_RESPONSE", "Protocol is not HTTP.")
+
         throw HTTPTransportException( SERVER_TRANSPORT_UNKNOWN_HTTP_RESPONSE,
                                       "Protocol is not HTTP.");
     }
@@ -1312,6 +1434,8 @@
         m_GetBytesState = eWaitingForHTTPHeader;
     else if (m_GetBytesState == eWaitingForHTTPHeader)
         m_GetBytesState = eSOAPMessageIsNotChunked;
+    
+    logExit()
 }
 
 /* HTTPTransport::processRootMimeBody() Is a public method used to
@@ -1320,6 +1444,8 @@
 void HTTPTransport::
 processRootMimeBody()
 {
+	logEntryTransport("HTTPTransport::processRootMimeBody")
+
     int numberOfBytesRead = 0;
     
     if( false == m_bReadPastRootMimeHeader)
@@ -1367,9 +1493,9 @@
             // Using m_strMimeReceived will be continued when getAttachment is called.
             m_bMimeTrue = false;
         }
-
-        return;
     }
+    
+    logExit()
 }
 
 /* HTTPTransport::processMimeHeaders() Is a public method used to
@@ -1378,6 +1504,8 @@
 void HTTPTransport::
 processMimeHeader()
 {
+	logEntryTransport("HTTPTransport::processMimeHeader")
+
     string::size_type pos = 0;
     string::size_type temppos = 0;
 
@@ -1421,6 +1549,8 @@
         temppos = m_strMimeContentLocation.find( "\r\n");
         m_strMimeContentLocation = m_strMimeContentLocation.substr( 0, temppos);
     }
+    
+    logExit()
 }
 
 void HTTPTransport::
@@ -1431,6 +1561,8 @@
 void HTTPTransport::
 getAttachment( char * pStrAttachment, int * pIntSize, int intAttachmentId)
 {
+	logEntryTransport("HTTPTransport::getAttachment")
+
     int numberOfBytesRead = 0;
     
     do
@@ -1446,6 +1578,8 @@
 
     m_strMimeReceived = m_strMimeReceived.substr( m_strMimeReceived.find( "\r\n\r\n"));
     processMimeBody();
+    
+    logExit()
 }
 
 void HTTPTransport::
@@ -1457,6 +1591,10 @@
 const char * HTTPTransport::
 getTransportProperty( const char * pcKey, bool response) throw (HTTPTransportException)
 {
+	logEntryTransport("HTTPTransport::getTransportProperty")
+	
+	const char *returnValue = NULL;
+
     std::string strKeyToFind = std::string( pcKey);
     std::vector < std::pair < std::string, std::string > > *hdrs=NULL;
     
@@ -1467,9 +1605,14 @@
 
     for( unsigned int i = 0; i < hdrs->size(); i++)
         if( (*hdrs)[i].first == strKeyToFind)
-            return (*hdrs)[i].second.c_str();
+        {
+        	returnValue = (*hdrs)[i].second.c_str();
+        	break;
+        }
 
-    return NULL;
+    logExitWithString(returnValue)
+
+    return returnValue;
 }
 
 const char * HTTPTransport::
@@ -1637,6 +1780,8 @@
 void HTTPTransport::
 readHTTPHeader()
 {    
+	logEntryTransport("HTTPTransport::readHTTPHeader")
+
     m_pActiveChannel->closeQuietly( false);
     
     // The parser is expecting a SOAP message.  Thus, the HTTP header must have
@@ -1667,6 +1812,10 @@
             else
             {
                 m_bReopenConnection = true;
+                
+                logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_INPUT_STREAMING_ERROR", 
+                		                   "Socket connection has been closed.")
+
                 throw HTTPTransportException( SERVER_TRANSPORT_INPUT_STREAMING_ERROR,
                                               "Socket connection has been closed.");
             }
@@ -1678,7 +1827,7 @@
         iHTTPEnd    = m_strReceived.find( ASCII_S_CRLFCRLF, iHTTPStart);
     
         m_strResponseHTTPHeaders = m_strReceived.substr( iHTTPStart, iHTTPEnd + 4 - iHTTPStart); 
-        
+                
         // Process the HTTP header
         processHTTPHeader();
         
@@ -1697,13 +1846,21 @@
           m_strResponseHTTPStatusMessage +  std::string("'\n");
 
         m_GetBytesState = eWaitingForHTTPHeader;
+        
+        logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_HTTP_EXCEPTION", 
+        		                  m_strResponseHTTPStatusMessage.c_str())
+
         throw HTTPTransportException( SERVER_TRANSPORT_HTTP_EXCEPTION, m_strResponseHTTPStatusMessage.c_str());
-    }      
+    }  
+    
+    logExit()
 }
 
 int HTTPTransport::
 getNextDataPacket( const char * pcszExceptionMessage, char *bufferToUse, int *bufferLen)
 {
+	logEntryTransport("HTTPTransport::getNextDataPacket")
+
     int numberOfBytesRead;
 
     // Read whatever part of the response message that has arrived at the active channel socket.
@@ -1732,15 +1889,24 @@
         m_bReopenConnection = true;
 
         if( pcszExceptionMessage != NULL && strlen( pcszExceptionMessage) > 0)
+        {
+            logThrowExceptionWithData("HTTPTransportException - SERVER_TRANSPORT_HTTP_EXCEPTION", 
+            		                  pcszExceptionMessage)
+
             throw HTTPTransportException( SERVER_TRANSPORT_HTTP_EXCEPTION, pcszExceptionMessage);
+        }
     }
 
+    logExitWithInteger(numberOfBytesRead)
+    
     return numberOfBytesRead;
 }
 
 int HTTPTransport::
 addCookie(const string name, const string value)
 {
+	logEntryTransport("HTTPTransport::addCookie")
+
     // trim the name
     string theName(name);
     trim(theName);
@@ -1761,12 +1927,16 @@
     if(!b_keyFound)
         m_vCookies.push_back( std::make_pair( theName, value));
     
+    logExit()
+    
     return true;
 }
 
 int HTTPTransport::
 addCookie(const string nameValuePair)
 {
+	logEntryTransport("HTTPTransport::addCookie")
+
     // Spec syntax : Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure
     // This code assumes it to be : Set-Cookie: NAME=VALUE; Anything_else
     // And discards stuff after first ';'
@@ -1780,6 +1950,9 @@
 
     // Now split the nameValue up
     string::size_type nameEndsAt = nameValue.find("=");
+    
+    logExit()
+    
     return addCookie(nameValue.substr(0, nameEndsAt), nameValue.substr(nameEndsAt+1));
 }
 
@@ -1826,3 +1999,15 @@
         str.erase(str.begin(), str.end());
 }
 
+void HTTPTransport::
+enableTrace(const char* logFilePath, const char *filters)
+{
+	AxisTrace::setLogFilter(filters);
+	AxisTrace::startTrace(logFilePath, false);
+	
+	if (m_pNormalChannel)
+		m_pNormalChannel->enableTrace(logFilePath, filters);
+	
+	if (m_pSecureChannel)
+		m_pSecureChannel->enableTrace(logFilePath, filters);
+}
\ No newline at end of file

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransport.hpp Thu Nov 13 14:13:23 2008
@@ -50,7 +50,7 @@
 {
   public:
     HTTPTransport ();
-    virtual ~ HTTPTransport ();
+    virtual ~HTTPTransport ();
 
   /**
     * Sets the endpoint URI. 
@@ -107,6 +107,8 @@
     ISoapAttachment**       getAllAttachments(int *pAttchArraySize) { return NULL;}; 
     char *					getIncomingSOAPMimeHeaders() {return NULL;}
 	const char *			getLastChannelError();
+	
+    void enableTrace(const char* logFilePath, const char *filters);
 
   protected:
     void					processRootMimeBody();

Modified: webservices/axis/trunk/c/src/transport/axis3/HTTPTransportInstantiator.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/HTTPTransportInstantiator.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/HTTPTransportInstantiator.cpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/HTTPTransportInstantiator.cpp Thu Nov 13 14:13:23 2008
@@ -23,10 +23,6 @@
 // !!! This include file must be first thing in file !!!
 #include "../../platforms/PlatformAutoSense.hpp"
 
-#ifndef AXISTRACE_LIBRARY_MAINENTRYPOINT
-#define AXISTRACE_LIBRARY_MAINENTRYPOINT
-#endif
-
 #include "../../common/AxisTrace.h"
 
 #include "HTTPTransport.hpp"
@@ -55,12 +51,9 @@
         return AXIS_FAIL;
     }
 
-    STORAGE_CLASS_INFO void initializeLibrary (AxisTraceEntrypoints* ep)
+    STORAGE_CLASS_INFO void initializeLibrary (void)
     {
         // Do init actions
-#ifdef ENABLE_AXISTRACE
-        AxisTrace::setTraceEntrypoints(ep);
-#endif
     }
 
     //  uninitializeLibrary() Is a C interface.

Modified: webservices/axis/trunk/c/src/transport/axis3/IChannel.hpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/transport/axis3/IChannel.hpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/transport/axis3/IChannel.hpp (original)
+++ webservices/axis/trunk/c/src/transport/axis3/IChannel.hpp Thu Nov 13 14:13:23 2008
@@ -61,6 +61,7 @@
     virtual void                setProxy(const char *pcProxyHost,unsigned int uiProxyPort)=0;
     virtual bool                reopenRequired()=0;
     virtual void                closeQuietly( bool bNoExceptionOnForceClose) = 0;
+    virtual void                enableTrace(const char* logFilePath, const char *filters) { }
 };
 
 #endif

Modified: webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp (original)
+++ webservices/axis/trunk/c/src/wsdd/WSDDDeployment.cpp Thu Nov 13 14:13:23 2008
@@ -37,6 +37,8 @@
 WSDDDeployment::
 WSDDDeployment()
 {
+	logEntryEngine("WSDDDeployment::WSDDDeployment")
+
     m_DeployedServices = NULL;
     m_sAux = "";
     m_pTransportHandlers = NULL;
@@ -44,11 +46,15 @@
     m_GlobalRequestHandlers = NULL;
     m_DeplType = DT_DEPLOYMENT;
     m_pLibNameIdMap = new map<AxisString, int>;
+    
+	logExit()
 }
 
 WSDDDeployment::
 ~WSDDDeployment()
 {
+	logEntryEngine("WSDDDeployment::~WSDDDeployment")
+
     WSDDHandlerList::iterator iter;
     delete m_pTransportHandlers;
 
@@ -67,6 +73,8 @@
 
     delete m_DeployedServices;
     delete m_pLibNameIdMap;
+    
+	logExit()
 }
 
 const WSDDHandlerList* WSDDDeployment::
@@ -97,6 +105,8 @@
 int WSDDDeployment::
 loadWSDD( const AxisChar * sWSDD)
 {
+	logEntryEngine("WSDDDeployment::loadWSDD")
+
     m_sWSDDPath = std::string( sWSDD);
 
     WSDDDocument *doc = new WSDDDocument( m_pLibNameIdMap);
@@ -106,8 +116,14 @@
     delete doc;
     
     if (AXIS_FAIL == rc)
+    {
+    	 logThrowException("AxisWsddException - SERVER_WSDD_FILE_NOT_FOUND")
+
          throw AxisWsddException(SERVER_WSDD_FILE_NOT_FOUND);
-         
+    }
+        
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
@@ -190,6 +206,8 @@
 const WSDDService* WSDDDeployment::
 getService(const AxisChar* sServiceName)
 {
+	logSetFunctionNameEngine("WSDDDeployment::getService")
+	
     WSDDServiceMap::iterator iter;
     if (!m_DeployedServices) 
         return NULL;
@@ -206,6 +224,8 @@
     {
         e = e;
 
+   	    logThrowExceptionWithData("AxisWsddException - SERVER_WSDD_EXCEPTION", e.what())
+
         throw AxisWsddException(SERVER_WSDD_EXCEPTION);
     }
 }
@@ -232,22 +252,37 @@
 int WSDDDeployment::
 addService(WSDDService* pService)
 {
+	logEntryEngine("WSDDDeployment::addService")
+
     if (!m_DeployedServices) 
         m_DeployedServices = new WSDDServiceMap;
     
     if (m_DeployedServices->find(pService->getServiceName()) != m_DeployedServices->end())
     {
-        AXISTRACE1("The service already exists and the attempt to re-deploy is ignored", WARN);
+    	logWarning("The service already exists and the attempt to re-deploy is ignored.")
     }
     else
         (*m_DeployedServices)[pService->getServiceName()] = pService;
 
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }        
 
 int WSDDDeployment::
 addHandler(bool bGlobal, bool bRequestFlow, WSDDHandler* pHandler, AXIS_PROTOCOL_TYPE protocol)
 {
+	logEntryEngine("WSDDDeployment::addHandler")
+	
+	if (pHandler)
+	{
+		logDebugArg4("Adding handler %s, global=%s, request=%s, response=%s", 
+				     pHandler->getLibName(), 
+				     bGlobal ? "yes" : "no",
+				     bRequestFlow ? "yes" : "no", 
+				     bRequestFlow ? "no"  : "yes")
+	}
+
     if (bGlobal)
     {
         if (bRequestFlow)
@@ -269,6 +304,9 @@
             m_pTransportHandlers = new WSDDTransport();
         m_pTransportHandlers->addHandler(bRequestFlow, protocol, pHandler);
     }
+	
+	logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
@@ -327,6 +365,7 @@
             return AXIS_NO_SUCH_HANDLER;
         return m_pTransportHandlers->removeHandler(bRequestFlow, protocol, pHandler);
     }
+    
     return AXIS_NO_SUCH_HANDLER;    
 }
 

Modified: webservices/axis/trunk/c/src/wsdd/WSDDDocument.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/wsdd/WSDDDocument.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdd/WSDDDocument.cpp (original)
+++ webservices/axis/trunk/c/src/wsdd/WSDDDocument.cpp Thu Nov 13 14:13:23 2008
@@ -64,7 +64,6 @@
     /* this enables the access to Deployment object while parsing */
     if (AXIS_SUCCESS != parseDocument(pcWSDDFileName))
     {
-        AXISTRACE1("Deployment descripter loading failed", CRITICAL);
         return AXIS_FAIL;
     }
     return AXIS_SUCCESS;
@@ -145,7 +144,6 @@
     XMLParser* pParser = XMLParserFactory::getParserObject();
     if (!pParser)
     {
-        AxisTrace::trace("Failed to getXMLParser to load WSDDDocument with");
         return AXIS_FAIL;
     }
     

Modified: webservices/axis/trunk/c/src/xml/XMLParser.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/xml/XMLParser.h?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/XMLParser.h (original)
+++ webservices/axis/trunk/c/src/xml/XMLParser.h Thu Nov 13 14:13:23 2008
@@ -191,6 +191,13 @@
      * @return true if more data to parse; false otherwise. 
      */
     virtual bool canParseMore() { return m_bCanParseMore; }
+    
+    /**
+      * Enable trace.
+      *  @param logFilePath  path to log file. 
+      *  @param filters      log filters.  See common/AxisTrace.h.
+      */
+      virtual void enableTrace(const char* logFilePath, const char *filters) { }
 
 protected:
     AxisIOStream* m_pInputStream;

Modified: webservices/axis/trunk/c/src/xml/xerces/ParserLoader.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/xml/xerces/ParserLoader.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/ParserLoader.cpp (original)
+++ webservices/axis/trunk/c/src/xml/xerces/ParserLoader.cpp Thu Nov 13 14:13:23 2008
@@ -23,7 +23,6 @@
 // !!! This include file must be first thing in file !!!
 #include "../../platforms/PlatformAutoSense.hpp"
 
-#define AXISTRACE_LIBRARY_MAINENTRYPOINT
 #include "../../common/AxisTrace.h"
 
 #include "XMLParserXerces.h"
@@ -64,12 +63,9 @@
 	return AXIS_FAIL;
 }
 
-STORAGE_CLASS_INFO void initializeLibrary (AxisTraceEntrypoints* ep)
+STORAGE_CLASS_INFO void initializeLibrary (void)
 {
       // Do init actions
-#ifdef ENABLE_AXISTRACE
-      AxisTrace::setTraceEntrypoints(ep);
-#endif
 }
 
 //  uninitializeLibrary() Is a C interface.

Modified: webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp (original)
+++ webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.cpp Thu Nov 13 14:13:23 2008
@@ -32,27 +32,37 @@
 XMLParserXerces::
 XMLParserXerces() : XMLParser()
 {
+	logEntryParser("XMLParserXerces::XMLParserXerces")
+
     m_pInputSource = NULL;
     m_bFirstParsed = false;
     m_bPeeked = false;
     m_bStartEndElement = false;
     m_pParser = XMLReaderFactory::createXMLReader();
     m_pParser->setErrorHandler(&m_Xhandler);
+    
+    logExit()
 }
 
 XMLParserXerces::
 ~XMLParserXerces()
 {
+	logEntryParser("XMLParserXerces::~XMLParserXerces")
+
     // Parser has memory allocated with the last AnyElement parsed; clean that
     m_Xhandler.freeElement();
 
     delete m_pInputSource;
     delete m_pParser;
+    
+    logExit()
 }
 
 int XMLParserXerces::
 setInputStream(AxisIOStream* pInputStream)
 {
+	logEntryParser("XMLParserXerces::setInputStream")
+
     m_pInputStream = pInputStream;
     
     delete m_pInputSource;
@@ -68,6 +78,8 @@
     m_iStatus = AXIS_SUCCESS;
     m_sErrorString = "";
     
+    logExitWithReturnCode(AXIS_SUCCESS)
+
     return AXIS_SUCCESS;
 }
 
@@ -80,6 +92,8 @@
 const AnyElement* XMLParserXerces::
 parse(bool ignoreWhitespace, bool peekIt)
 {
+	logEntryParser("XMLParserXerces::parse")
+
     try 
     {
         // Need to do a parseFirst() to kick off parsing
@@ -92,7 +106,11 @@
             
             m_bFirstParsed = true;
             if (!m_bCanParseMore)
+            {
+                logExitWithPointer(NULL)
+
                 return (const AnyElement*)NULL;
+            }
         }
 
         // release any element that has been consumed
@@ -156,6 +174,8 @@
         }
         
         // Return element
+        logExitWithPointer(elem)
+
         return (const AnyElement*)elem;
     } 
     catch( const SAXParseException& e) 
@@ -166,6 +186,8 @@
         m_iStatus = AXIS_FAIL;
         XMLString::release( &message);
         
+        logThrowExceptionWithData("AxisParseException", m_sErrorString.c_str())
+        
         throw AxisParseException(m_iErrorCode, m_sErrorString.c_str());
     } 
     catch( const XMLException& e)
@@ -176,6 +198,8 @@
         m_iStatus = AXIS_FAIL;
         XMLString::release( &message);
         
+        logThrowExceptionWithData("AxisParseException", m_sErrorString.c_str())
+
         throw AxisParseException(m_iErrorCode, m_sErrorString.c_str());        
     }    
     catch( HTTPTransportException & e)
@@ -184,6 +208,8 @@
         m_iErrorCode = SERVER_PARSE_TRANSPORT_FAILED;
         m_iStatus = AXIS_FAIL;
         
+        logThrowExceptionWithData("AxisParseException", m_sErrorString.c_str())
+
         throw AxisParseException(m_iErrorCode, m_sErrorString.c_str());        
     }    
     catch(...) 
@@ -192,16 +218,26 @@
         m_iErrorCode = SERVER_PARSE_PARSER_FAILED;
         m_iStatus = AXIS_FAIL;
         
+        logThrowExceptionWithData("AxisParseException", m_sErrorString.c_str())
+
         throw AxisParseException(m_iErrorCode, m_sErrorString.c_str());         
     }
     
+    logExitWithPointer(NULL)
+
     return (const AnyElement*)NULL;
 }
 
 const AnyElement* XMLParserXerces::
 next(bool isCharData)
 {    
-    return parse(isCharData ? false : true);
+	logEntryParser("XMLParserXerces::next")
+
+    const AnyElement* returnValue = parse(isCharData ? false : true);
+	
+    logExitWithPointer(returnValue)
+
+	return returnValue;
 }
 
 // New method which peek a head next element 
@@ -209,31 +245,36 @@
 const char* XMLParserXerces::
 peek()
 {   
+	logEntryParser("XMLParserXerces::peek")
+
+    const char* returnValue = "";
+
     // peek() is used to determine optional elements or elements 
     // that are not in order (e.g. xsd:all support) - return a null string if 
     // the last node processed was a start/end element
-    if (m_bStartEndElement)
-        return "";
-    
-    // get element, ignoring whitespace and indicating this is a peek operation   
-    const AnyElement* elem = parse(true, true);
-    if (!elem)
-        return "";
-    
-    // We return null string if end-element or unknown type is encountered
-    const XML_NODE_TYPE type = m_Xhandler.peekNextElementType();
-    if(type != END_ELEMENT && type != END_PREFIX && type != UNKNOWN)
+    if (!m_bStartEndElement)
     {
-        const char* name = m_Xhandler.peekNextElementName();
-        return name;
+	    // get element, ignoring whitespace and indicating this is a peek operation   
+	    const AnyElement* elem = parse(true, true);
+	    if (elem)
+	    {
+		    // We return null string if end-element or unknown type is encountered
+		    const XML_NODE_TYPE type = m_Xhandler.peekNextElementType();
+		    if(type != END_ELEMENT && type != END_PREFIX && type != UNKNOWN)
+		    	returnValue = m_Xhandler.peekNextElementName();
+	    }
     }
-    else
-        return "";
+    
+    logExitWithString(returnValue)
+
+    return returnValue;
 }
 
 const AnyElement* XMLParserXerces::
 anyNext()
 {
+	logEntryParser("XMLParserXerces::anyNext")
+
     // Say the SAX event handler to record prefix mappings too 
     // By default the event handler do not record them.
     m_Xhandler.setGetPrefixMappings(true);
@@ -244,6 +285,8 @@
     // Reset prefix mapping
     m_Xhandler.setGetPrefixMappings(false);
     
+    logExitWithPointer(elem)
+
     return elem;
 }
 
@@ -252,3 +295,10 @@
 {
     return m_Xhandler.prefix4NS(pcNS);
 }
+
+void XMLParserXerces::
+enableTrace(const char* logFilePath, const char *filters)
+{
+	AxisTrace::setLogFilter(filters);
+	AxisTrace::startTrace(logFilePath, false);
+}
\ No newline at end of file

Modified: webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.h
URL: http://svn.apache.org/viewvc/webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.h?rev=713841&r1=713840&r2=713841&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.h (original)
+++ webservices/axis/trunk/c/src/xml/xerces/XMLParserXerces.h Thu Nov 13 14:13:23 2008
@@ -47,6 +47,8 @@
     const char* peek();
     const XML_Ch* getPrefix4NS(const XML_Ch* pcNS);
 
+    void enableTrace(const char* logFilePath, const char *filters);
+    
 private:
     const AnyElement* parse(bool ignoreWhitespace=true, bool peekIt=false);
 



Mime
View raw message