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 su...@apache.org on 2004/04/01 10:50:35 UTC

cvs commit: ws-axis/c/src/wsdd WSDDDeployment.cpp

susantha    2004/04/01 00:50:35

  Modified:    c/include/axis/server SoapFaults.h
               c/samples/client/interoptests/base InteropTestPortType.cpp
               c/src/common AxisConfig.cpp BasicTypeSerializer.cpp
               c/src/engine/server ServerAxisEngine.cpp
               c/src/soap SoapParserExpat.cpp
               c/src/wsdd WSDDDeployment.cpp
  Removed:     c/src/engine Main.c
  Log:
  Fixed the server side crashing upon the transport returns TRANPORT_FINISHED state
  
  Revision  Changes    Path
  1.10      +2 -0      ws-axis/c/include/axis/server/SoapFaults.h
  
  Index: SoapFaults.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapFaults.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- SoapFaults.h	23 Mar 2004 06:11:44 -0000	1.9
  +++ SoapFaults.h	1 Apr 2004 08:50:34 -0000	1.10
  @@ -92,6 +92,7 @@
   	SF_MUST_UNDERSTAND,
   
   	//Client faults
  +	SF_MESSAGEINCOMPLETE,
   	SF_SOAPACTIONEMPTY,
   	SF_SERVICENOTFOUND,
   	SF_SOAPCONTENTERROR,
  @@ -126,6 +127,7 @@
   	/*SF_MUST_UNDERSTAND*/	{"MustUnderstand", "Soap Must Understand  error", "none", ""},
   
   //Client faults
  +	/*SF_MESSAGEINCOMPLETE*/{"Client", "Soap message is incorrect or incomplete", "none", ""},
   	/*SF_SOAPACTIONEMPTY*/	{"Client", "Soap Action header empty", "none", ""},
   	/*SF_SERVICENOTFOUND*/	{"Client", "Requested service is not registerd at the server", "none", ""},
   	/*SF_SOAPCONTENTERROR*/ {"Client", "Soap content is not valid", "none", ""},
  
  
  
  1.10      +1 -1      ws-axis/c/samples/client/interoptests/base/InteropTestPortType.cpp
  
  Index: InteropTestPortType.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/interoptests/base/InteropTestPortType.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- InteropTestPortType.cpp	30 Mar 2004 14:16:41 -0000	1.9
  +++ InteropTestPortType.cpp	1 Apr 2004 08:50:35 -0000	1.10
  @@ -21,7 +21,7 @@
   {
   	m_pCall = new Call();
   	m_pCall->SetProtocol(APTHTTP);
  -	m_pCall->SetEndpointURI("http://localhost/axis/base");
  +	m_pCall->SetEndpointURI("http://localhost:5555/axis/InteropBase");
   }
   
   InteropTestPortType::~InteropTestPortType()
  
  
  
  1.15      +9 -50     ws-axis/c/src/common/AxisConfig.cpp
  
  Index: AxisConfig.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisConfig.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- AxisConfig.cpp	31 Mar 2004 15:05:41 -0000	1.14
  +++ AxisConfig.cpp	1 Apr 2004 08:50:35 -0000	1.15
  @@ -68,25 +68,11 @@
   
   AxisConfig::AxisConfig()
   {
  -    m_sWsddFilePath = (char*) malloc(CONFBUFFSIZE);
  -    m_sAxisLogPath = (char*) malloc(CONFBUFFSIZE);
  -	m_sClientWsddFilePath = (char*) malloc(CONFBUFFSIZE);
  -        m_sAxisHome = (char*) malloc(CONFBUFFSIZE);
  +    m_sWsddFilePath = 0;
  +    m_sAxisLogPath = 0;
  +	m_sClientWsddFilePath = 0;
  +    m_sAxisHome = 0;
       m_sValue = NULL;
  -
  -    /*assigning default values for configuration variables*/
  -    /*#ifdef WIN32
  -        strcpy(m_sWsddFilePath, "c:/Axis/conf/server.wsdd");
  -        strcpy(m_sAxisLogPath, "c:/Axis/conf/AxisLog");
  -		m_sClientWsddFilePath
  -
  -    #else
  -        strcpy(m_sWsddFilePath, "/usr/local/apache/Axis/conf/server.wsdd");
  -        strcpy(m_sAxisLogPath, "/usr/local/apache/Axis/logs/AxisLog");
  -		m_sClientWsddFilePath
  -    #endif
  -    */
  -
   }
   
   AxisConfig::~AxisConfig()
  @@ -94,7 +80,7 @@
       if(m_sWsddFilePath) delete m_sWsddFilePath;
       if(m_sAxisLogPath) delete m_sAxisLogPath;
   	if(m_sClientWsddFilePath) delete m_sClientWsddFilePath;
  -        if(m_sAxisHome) delete m_sAxisHome;
  +    if(m_sAxisHome) delete m_sAxisHome;
       if(m_sValue) delete m_sValue;
   
   }
  @@ -113,6 +99,7 @@
   	sConfPath = getenv("AXIS_HOME");
       if (!sConfPath)
           return AXIS_FAIL;
  +	m_sAxisHome = (char*) malloc(CONFBUFFSIZE);
       strcpy(m_sAxisHome, sConfPath);        
     
   	strcpy(sNewConfPath, sConfPath);
  @@ -120,37 +107,6 @@
       if ((fileConfig = fopen(sNewConfPath, "r")) == NULL)
   		return AXIS_FAIL;
   
  -    /*while(fgets(m_sLine, CONFBUFFSIZE, fileConfig) != NULL)
  -    {
  -        int k=0;
  -		AxisUtils::clearArray(key, CONFBUFFSIZE);
  -        while(line[k] != ':')
  -        {
  -            key[k]=line[k];
  -            k += 1;
  -
  -        }
  -        k += 1;
  -        int j=0;
  -		
  -		
  -		 //To clear the character array named value
  -		 
  -		AxisUtils::clearArray(value, CONFBUFFSIZE);
  -
  -        while((line[k] != '\n') && (line[k]!='\0'))
  -        {
  -            value[j]=line[k];
  -            k += 1;
  -            j += 1;
  -
  -        }
  -        if(strcmp(key, "WSDDFILEPATH") == 0)
  -            strcpy(m_sWsddFilePath, value);
  -        if(strcmp(key, "AXISLOGPATH") == 0)
  -            strcpy(m_sAxisLogPath, value);
  -    
  -    }*/
       while(fgets(m_sLine, CONFBUFFSIZE, fileConfig) != NULL)
       {
           int linesize = strlen(m_sLine);
  @@ -162,16 +118,19 @@
   
           if(strcmp(key, "WSDDFILEPATH") == 0)
           {
  +			m_sWsddFilePath = (char*) malloc(CONFBUFFSIZE);
               strncpy(m_sWsddFilePath, m_sValue + 1, linesize  - strlen(key) - 2);
               m_sWsddFilePath[linesize  - strlen(key) - 2] = '\0';
           }
           if(strcmp(key, "AXISLOGPATH") == 0)
           {
  +			m_sAxisLogPath = (char*) malloc(CONFBUFFSIZE);
               strncpy(m_sAxisLogPath, m_sValue + 1, linesize  - strlen(key) - 2);
               m_sAxisLogPath[linesize  - strlen(key) - 2] = '\0';
           }
   		if(strcmp(key, "CLIENTWSDDFILEPATH") == 0)
           {
  +			m_sClientWsddFilePath = (char*) malloc(CONFBUFFSIZE);
               strncpy(m_sClientWsddFilePath, m_sValue + 1, linesize  - strlen(key) - 2);
               m_sClientWsddFilePath[linesize  - strlen(key) - 2] = '\0';
           }
  
  
  
  1.23      +11 -8     ws-axis/c/src/common/BasicTypeSerializer.cpp
  
  Index: BasicTypeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/BasicTypeSerializer.cpp,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- BasicTypeSerializer.cpp	24 Mar 2004 06:57:31 -0000	1.22
  +++ BasicTypeSerializer.cpp	1 Apr 2004 08:50:35 -0000	1.23
  @@ -67,10 +67,8 @@
   
   #include <stdio.h>
   #include <axis/server/BasicTypeSerializer.h>
  -
  -//////////////////////////////////////////////////////////////////////
  -// Construction/Destruction
  -//////////////////////////////////////////////////////////////////////
  +#include "../soap/apr_base64.h"
  +#include "../soap/HexCoder.h"
   
   BasicTypeSerializer::BasicTypeSerializer()
   {
  @@ -188,15 +186,20 @@
   
   const AxisChar* BasicTypeSerializer::EncodeToHexBinary(const xsd__hexBinary* pBinary)
   {
  -	m_AuxStr = "";
  -	/*TODO*/
  +	char *outstr = (char*) malloc(pBinary->__size*2);
  +	Hex_Encode(outstr, pBinary->__ptr, pBinary->__size);
  +	m_AuxStr = outstr;
  +	free(outstr);
   	return m_AuxStr.c_str();
   }
   
   const AxisChar* BasicTypeSerializer::EncodeToBase64Binary(const xsd__base64Binary* pBinary)
   {
  -	m_AuxStr="";
  -	/*TODO*/
  +	int len = apr_base64_encode_len(pBinary->__size);
  +	char *outstr = (char*) malloc(len);
  +	apr_base64_encode_binary(outstr, pBinary->__ptr, len);
  +	m_AuxStr = outstr;
  +	free(outstr);
   	return m_AuxStr.c_str();
   }
   
  
  
  
  1.2       +6 -0      ws-axis/c/src/engine/server/ServerAxisEngine.cpp
  
  Index: ServerAxisEngine.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/server/ServerAxisEngine.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServerAxisEngine.cpp	24 Mar 2004 12:48:41 -0000	1.1
  +++ ServerAxisEngine.cpp	1 Apr 2004 08:50:35 -0000	1.2
  @@ -122,6 +122,12 @@
   			/* check for stream version in the request and decide whether we support it or not
   			 * if we do not support send a soapfault with version mismatch.	*/	  
   			nSoapVersion = m_pDZ->GetVersion();
  +			if (m_pDZ->GetStatus() != AXIS_SUCCESS)
  +			{
  +				m_pSZ->setSoapFault(SoapFault::getSoapFault(SF_MESSAGEINCOMPLETE));
  +				break; //do .. while(0)
  +			}
  +
   			if (nSoapVersion == VERSION_LAST) /* version not supported */
   			{
   				m_pSZ->setSoapVersion(SOAP_VER_1_2);
  
  
  
  1.13      +4 -2      ws-axis/c/src/soap/SoapParserExpat.cpp
  
  Index: SoapParserExpat.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapParserExpat.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SoapParserExpat.cpp	31 Mar 2004 13:50:00 -0000	1.12
  +++ SoapParserExpat.cpp	1 Apr 2004 08:50:35 -0000	1.13
  @@ -183,7 +183,8 @@
   		if (m_Events.empty())
   		{
   			nStatus = ParseNext();
  -			if ((TRANSPORT_FAILED == nStatus) || (TRANSPORT_FINISHED == nStatus)) return NULL;
  +			if (TRANSPORT_FAILED == nStatus) return NULL;
  +			if ((TRANSPORT_FINISHED == nStatus) && m_Events.empty()) return NULL;
   			if (AXIS_FAIL == m_nStatus) return NULL;
   		}
   
  @@ -196,7 +197,8 @@
   			{
   				m_Events.push(m_pLastEvent);
   				nStatus = ParseNext();
  -				if ((TRANSPORT_FAILED == nStatus) || (TRANSPORT_FINISHED == nStatus)) return NULL;
  +				if (TRANSPORT_FAILED == nStatus) return NULL;
  +				if ((TRANSPORT_FINISHED == nStatus) && m_Events.empty()) return NULL;
   			}
   			else
   			{
  
  
  
  1.27      +1 -0      ws-axis/c/src/wsdd/WSDDDeployment.cpp
  
  Index: WSDDDeployment.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdd/WSDDDeployment.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- WSDDDeployment.cpp	31 Mar 2004 15:05:41 -0000	1.26
  +++ WSDDDeployment.cpp	1 Apr 2004 08:50:35 -0000	1.27
  @@ -241,6 +241,7 @@
   const WSDDService* WSDDDeployment::GetService(const AxisChar* sServiceName)
   {
   	WSDDServiceMap::iterator iter;
  +	if (!m_DeployedServices) return NULL;
   	iter = m_DeployedServices->find(sServiceName);
   	if (iter != m_DeployedServices->end())
   	{