You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by pr...@apache.org on 2005/12/15 15:03:32 UTC
svn commit: r357014 - in /webservices/axis/trunk/c/src:
common/AxisConfig.cpp common/AxisConfig.h engine/Axis.cpp
Author: prestonf
Date: Thu Dec 15 06:03:26 2005
New Revision: 357014
URL: http://svn.apache.org/viewcvs?rev=357014&view=rev
Log:
Changes required to the files to correct the Programmatic Configuration problems.
Modified:
webservices/axis/trunk/c/src/common/AxisConfig.cpp
webservices/axis/trunk/c/src/common/AxisConfig.h
webservices/axis/trunk/c/src/engine/Axis.cpp
Modified: webservices/axis/trunk/c/src/common/AxisConfig.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/AxisConfig.cpp?rev=357014&r1=357013&r2=357014&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/AxisConfig.cpp (original)
+++ webservices/axis/trunk/c/src/common/AxisConfig.cpp Thu Dec 15 06:03:26 2005
@@ -34,7 +34,7 @@
AXIS_CPP_NAMESPACE_START
-AxisConfig::AxisConfig ()
+AxisConfig::AxisConfig()
{
m_pcKeyArray[AXCONF_WSDDFILEPATH] = "WSDDFilePath";
m_pcKeyArray[AXCONF_LOGPATH] = "LogPath";
@@ -63,6 +63,67 @@
m_pcValueArray[AXCONF_AXISHOME] = PLATFORM_DEFAULT_DEPLOY_PATH;
}
+//AxisConfig::AxisConfig( bool bDefaultsOnly)
+AxisConfig::AxisConfig( AxisConfig * pOrgAxisConfig)
+{
+ m_pcKeyArray[AXCONF_WSDDFILEPATH] = "WSDDFilePath";
+ m_pcKeyArray[AXCONF_LOGPATH] = "LogPath";
+ m_pcKeyArray[AXCONF_CLIENTLOGPATH] = "ClientLogPath";
+ m_pcKeyArray[AXCONF_CLIENTWSDDFILEPATH] = "ClientWSDDFilePath";
+
+ m_pcKeyArray[AXCONF_AXISHOME] = "\0"; // will be obtained dynamically.
+ m_pcKeyArray[AXCONF_TRANSPORTHTTP] = "Transport_http";
+ m_pcKeyArray[AXCONF_SSLCHANNEL_HTTP]= "Channel_HTTP_SSL";
+ m_pcKeyArray[AXCONF_CHANNEL_HTTP] = "Channel_HTTP";
+ m_pcKeyArray[AXCONF_TRANSPORTSMTP] = "Transport_smtp";
+ m_pcKeyArray[AXCONF_XMLPARSER] = "XMLParser";
+ m_pcKeyArray[AXCONF_NODENAME] = "NodeName";
+ m_pcKeyArray[AXCONF_LISTENPORT] = "ListenPort";
+ m_pcKeyArray[AXCONF_SECUREINFO] = "SecureInfo";
+
+ char * pszDefaultValues[] = {"", // (AXCONF_WSDDFILEPATH) Server WSDD File Path
+ PLATFORM_LOG_PATH, // (AXCONF_LOGPATH) Server log path
+ PLATFORM_CLIENTLOG_PATH, // (AXCONF_CLIENTLOGPATH) Client log path
+ "", // (AXCONF_CLIENTWSDDFILEPATH) Client WSDD File Path
+ PLATFORM_DEFAULT_DEPLOY_PATH, // (AXCONF_AXISHOME) Axis home
+ PLATFORM_TRANSPORTHTTP_PATH, // (AXCONF_TRANSPORTHTTP) Transport HTTP path
+ "", // (AXCONF_TRANSPORTSMTP) Transport SMTP path
+ PLATFORM_XMLPARSER_PATH, // (AXCONF_XMLPARSER) XML Parser path
+ "server name", // (AXCONF_NODENAME) Node name
+ "listen port", // (AXCONF_LISTENPORT) Listener port
+ PLATFORM_SSLCHANNEL_PATH, // (AXCONF_SSLCHANNEL_HTTP) HTTP SSL Channel
+ PLATFORM_CHANNEL_PATH, // (AXCONF_CHANNEL_HTTP) HTTP Channel
+ PLATFORM_SECUREINFO}; // (AXCONF_SECUREINFO) HTTP SSL secure information
+
+ for( int iPropertyCount = 0; iPropertyCount < AXCONF_LAST; iPropertyCount++)
+ {
+ char * pszValue = pOrgAxisConfig->getAxisConfProperty( (g_axconfig) iPropertyCount);
+
+ if( pszValue == NULL)
+ {
+ m_pcValueArray[iPropertyCount] = pszDefaultValues[iPropertyCount];
+ }
+ else
+ {
+ m_pcValueArray[iPropertyCount] = pszValue;
+ }
+ }
+
+ delete pOrgAxisConfig;
+/*
+ m_pcValueArray[AXCONF_NODENAME] = "server name";
+ m_pcValueArray[AXCONF_LISTENPORT] = "listen port";
+ m_pcValueArray[AXCONF_XMLPARSER] = PLATFORM_XMLPARSER_PATH;
+ m_pcValueArray[AXCONF_TRANSPORTHTTP] = PLATFORM_TRANSPORTHTTP_PATH;
+ m_pcValueArray[AXCONF_LOGPATH] = PLATFORM_LOG_PATH;
+ m_pcValueArray[AXCONF_CLIENTLOGPATH] = PLATFORM_CLIENTLOG_PATH;
+ m_pcValueArray[AXCONF_SSLCHANNEL_HTTP] = PLATFORM_SSLCHANNEL_PATH;
+ m_pcValueArray[AXCONF_CHANNEL_HTTP] = PLATFORM_CHANNEL_PATH;
+ m_pcValueArray[AXCONF_SECUREINFO] = PLATFORM_SECUREINFO;
+ m_pcValueArray[AXCONF_AXISHOME] = PLATFORM_DEFAULT_DEPLOY_PATH;
+*/
+}
+
int AxisConfig::readConfFile ()
{
char carrLine[CONFBUFFSIZE];
@@ -166,7 +227,6 @@
// no need to copy the value into our own storage here.
m_pcValueArray[valueindex] = value;
}
-
char* AxisConfig::getAxisConfProperty (g_axconfig property)
{
Modified: webservices/axis/trunk/c/src/common/AxisConfig.h
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/common/AxisConfig.h?rev=357014&r1=357013&r2=357014&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/common/AxisConfig.h (original)
+++ webservices/axis/trunk/c/src/common/AxisConfig.h Thu Dec 15 06:03:26 2005
@@ -67,6 +67,8 @@
{
public:
AxisConfig();
+// AxisConfig( bool bDefaultsOnly);
+ AxisConfig( AxisConfig * pOrgAxisConfig);
/**
* This method will read from the configuration file called axiscpp.conf
@@ -87,11 +89,9 @@
char* getAxisConfProperty(g_axconfig property);
void setValue(int valuelength, g_axconfig valueindex, char* value);
- private:
+ private:
std::string m_pcKeyArray [AXCONF_LAST];
std::string m_pcValueArray [AXCONF_LAST];
-
-
};
AXIS_CPP_NAMESPACE_END
Modified: webservices/axis/trunk/c/src/engine/Axis.cpp
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/engine/Axis.cpp?rev=357014&r1=357013&r2=357014&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/engine/Axis.cpp (original)
+++ webservices/axis/trunk/c/src/engine/Axis.cpp Thu Dec 15 06:03:26 2005
@@ -105,7 +105,15 @@
g_pHandlerPool = new HandlerPool ();
// unsynchronized read-only global variables.
g_pWSDDDeployment = new WSDDDeployment ();
- g_pConfig = new AxisConfig ();
+
+ if( g_pConfig != NULL)
+ {
+ g_pConfig = new AxisConfig( g_pConfig);
+ }
+ else
+ {
+ g_pConfig = new AxisConfig();
+ }
}
void ModuleUnInitialize ()
@@ -348,10 +356,12 @@
URIMapping::initialize ();
SoapFault::initialize ();
ModuleInitialize ();
+
if (bServer) // no client side wsdd processing at the moment
{
// Read from the configuration file
status = g_pConfig->readConfFile ();
+
if (status == AXIS_SUCCESS)
{
try
@@ -383,7 +393,6 @@
{
throw AxisEngineException(e.getExceptionCode(), e.what());
}
-
}
else
{
@@ -399,15 +408,12 @@
#if defined(ENABLE_AXISTRACE)
status = AxisTrace::openFileByClient ();
#endif
-
XMLParserFactory::initialize();
SOAPTransportFactory::initialize();
- char *pClientWsddPath =
- g_pConfig->getAxisConfProperty(AXCONF_CLIENTWSDDFILEPATH);
+
+ char * pClientWsddPath = g_pConfig->getAxisConfProperty(AXCONF_CLIENTWSDDFILEPATH);
- /* May be there is no client side handlers configured. So may not
- * have CLIENTWSDDFILEPATH entry in axiscpp.conf
- */
+// May be there is no client side handlers configured. So may not have CLIENTWSDDFILEPATH entry in axiscpp.conf
if (pClientWsddPath)
{
if (AXIS_SUCCESS != g_pWSDDDeployment->loadWSDD (pClientWsddPath))
@@ -418,9 +424,9 @@
}
else
{
- AXISTRACE3("Reading from the configuration file failed. \
- Check for error in the configuration file. \n\
- Handlers and logging are not working");
+ AXISTRACE3( "Reading from the configuration file failed. \
+ Check for error in the configuration file.\n\
+ Handlers and logging are not working");
/* TODO:Improve the AxisTrace so that it will log these kind of
* messages into a log file according to the critical level
* specified.
@@ -435,7 +441,7 @@
}
else if (AxisEngine::m_bServer != bServer)
{
- throw AxisEngineException(SERVER_ENGINE_EXCEPTION);
+ throw AxisEngineException(SERVER_ENGINE_EXCEPTION);
}
}
catch (...)
@@ -795,5 +801,9 @@
;
}
}
+<<<<<<< .mine
+}
+=======
}
+>>>>>>> .r357010