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 da...@apache.org on 2003/12/11 15:10:35 UTC

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

damitha     2003/12/11 06:10:35

  Modified:    c/include/axis/common Tag:
                        Release-2003_10_26-bugfixes_branch AxisTrace.h
               c/include/axis/soap Tag: Release-2003_10_26-bugfixes_branch
                        SoapDeSerializer.h SoapSerializer.h
               c/samples/client/interoptests/base Tag:
                        Release-2003_10_26-bugfixes_branch
                        InteropTestPortType.cpp
               c/src/common Tag: Release-2003_10_26-bugfixes_branch
                        Packet.cpp
               c/src/engine Tag: Release-2003_10_26-bugfixes_branch
                        ClientAxisEngine.cpp ServerAxisEngine.cpp
               c/src/server/apache Tag: Release-2003_10_26-bugfixes_branch
                        mod_axis.c
               c/src/soap Tag: Release-2003_10_26-bugfixes_branch
                        SoapDeSerializer.cpp SoapSerializer.cpp
               c/src/wsdd Tag: Release-2003_10_26-bugfixes_branch
                        WSDDDocument.cpp
  Log:
  
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.4   +1 -1      ws-axis/c/include/axis/common/AxisTrace.h
  
  Index: AxisTrace.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/common/AxisTrace.h,v
  retrieving revision 1.4.2.3
  retrieving revision 1.4.2.4
  diff -u -r1.4.2.3 -r1.4.2.4
  --- AxisTrace.h	27 Nov 2003 12:59:43 -0000	1.4.2.3
  +++ AxisTrace.h	11 Dec 2003 14:10:34 -0000	1.4.2.4
  @@ -74,7 +74,7 @@
   #if !defined(__AXISTRACE__)
     #define AXISTRACE1(X,Y) "";
     #define AXISTRACE2(X,Y,Z) "";
  -  #define AXISTRACE3(X,Y) "";
  +  #define AXISTRACE3(X) "";
   #endif
   
   //extern unsigned char chEBuf[1024];
  
  
  
  No                   revision
  No                   revision
  1.2.2.3   +4 -3      ws-axis/c/include/axis/soap/SoapDeSerializer.h
  
  Index: SoapDeSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapDeSerializer.h,v
  retrieving revision 1.2.2.2
  retrieving revision 1.2.2.3
  diff -u -r1.2.2.2 -r1.2.2.3
  --- SoapDeSerializer.h	27 Nov 2003 12:59:44 -0000	1.2.2.2
  +++ SoapDeSerializer.h	11 Dec 2003 14:10:34 -0000	1.2.2.3
  @@ -67,7 +67,8 @@
   #include "../common/IHandlerSoapDeSerializer.h"
   #include "XMLStreamHandler.h"
   
  -#define HUGE_BUFFER_SIZE 8192
  +#define HUGE_BUFFER_SIZE 32768
  +//#define HUGE_BUFFER_SIZE 8192
   
   class SoapEnvelope;
   class SoapHeader;
  @@ -89,7 +90,7 @@
   	XMLStreamHandler* m_pHandler;
   	SAX2XMLReader* m_pParser;
   	const Ax_soapstream* m_pInputStream;
  -	char m_hugebuffer[HUGE_BUFFER_SIZE];
  +	char* m_hugebuffer;;
   	Param* m_pLastArrayParam;
   	int m_Status;
   public:
  @@ -103,7 +104,7 @@
   	SoapBody* GetBody();
   	ISoapHeader* GetHeader();
   	SoapEnvelope* GetEnvelope();
  -	int SetInputStream(const Ax_soapstream* pInputStream);
  +	int SetInputStream(const Ax_soapstream* pInputStream);    
   	SoapDeSerializer();
   	virtual ~SoapDeSerializer();
   	/** Method used by wrappers to get a deserialized Array of complex types */
  
  
  
  1.3.2.2   +7 -5      ws-axis/c/include/axis/soap/SoapSerializer.h
  
  Index: SoapSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/SoapSerializer.h,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- SoapSerializer.h	27 Nov 2003 12:59:44 -0000	1.3.2.1
  +++ SoapSerializer.h	11 Dec 2003 14:10:34 -0000	1.3.2.2
  @@ -70,8 +70,7 @@
   #include "../common/Packet.h"
   #include "SoapEnvVersions.h"
   
  -
  -#define SERIALIZE_BUFFER_SIZE 8192
  +#define INITIAL_SERIALIZE_BUFFER_SIZE 16384
   
   class SoapEnvelope;
   class SoapHeader;
  @@ -97,8 +96,10 @@
   	AxisChar cCounter[64];
   	SoapEnvelope* m_pSoapEnvelope;	
   	int m_iSoapVersion;
  -	char m_cSerializedBuffer[SERIALIZE_BUFFER_SIZE];
  +	//char m_cSerializedBuffer[SERIALIZE_BUFFER_SIZE];
  +    char* m_cSerializedBuffer;    
   	int m_iCurrentSerBufferSize;
  +    int m_iBufferSize; 
   public:
   	int createSoapMethod(const AxisChar* sLocalName, const AxisChar* sPrefix, const AxisChar* sURI);	
   //	IWrapperSoapSerializer& operator<<(const char* cSerialized);
  @@ -136,10 +137,11 @@
   	int AddOutputParam(const AxisChar* pchName, void* pObject, void* pDZFunct, void* pDelFunct);
   	int SerializeArray(const Axis_Array* pArray, void* pSZFunct, void* pDelFunct, void* pSizeFunct, const AxisChar* pchTypeName, const AxisChar* pchURI, const AxisChar* pchArrayName);
   	int SerializeArray(const Axis_Array* pArray, XSDTYPE nType, const AxisChar* pchArrayName);
  +    int flushSerializedBuffer();
  +    int GetContentLength();
   
   private:
  -	int AddOutputParamHelper(const AxisChar* pchName, XSDTYPE nType, uParamValue Value);
  -	int flushSerializedBuffer();
  +	int AddOutputParamHelper(const AxisChar* pchName, XSDTYPE nType, uParamValue Value);	
   	IArrayBean* makeArrayBean(XSDTYPE nType, void* pArray);
   	IArrayBean* makeArrayBean(void* pObject, void* pSZFunct, void* pDelFunct, void* pSizeFunct);
   
  
  
  
  No                   revision
  No                   revision
  1.1.2.5   +1 -1      ws-axis/c/samples/client/interoptests/base/Attic/InteropTestPortType.cpp
  
  Index: InteropTestPortType.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/samples/client/interoptests/base/Attic/InteropTestPortType.cpp,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- InteropTestPortType.cpp	30 Nov 2003 12:31:18 -0000	1.1.2.4
  +++ InteropTestPortType.cpp	11 Dec 2003 14:10:34 -0000	1.1.2.5
  @@ -19,7 +19,7 @@
   	m_pCall = new Call();
   	m_pCall->SetProtocol(APTHTTP);
   	m_pCall->SetHeader("SOAPAction", "InteropBase");
  -	m_pCall->SetEndpointURI("http://localhost/axis/InteropBase");
  +	m_pCall->SetEndpointURI("http://192.168.101.4:80/axis/InteropBase");
   }
   
   InteropTestPortType::~InteropTestPortType()
  
  
  
  No                   revision
  No                   revision
  1.9.2.1   +19 -6     ws-axis/c/src/common/Packet.cpp
  
  Index: Packet.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/Packet.cpp,v
  retrieving revision 1.9
  retrieving revision 1.9.2.1
  diff -u -r1.9 -r1.9.2.1
  --- Packet.cpp	20 Oct 2003 03:24:29 -0000	1.9
  +++ Packet.cpp	11 Dec 2003 14:10:34 -0000	1.9.2.1
  @@ -63,21 +63,34 @@
   #include <string.h>
   #include <stdlib.h>
   #include <stdio.h>
  +#include <axis/common/AxisTrace.h>
   
   
   int set_header(Ax_soapstream* soap, char * pchkey, char * pchvalue)
   {
  -	int count = soap->so.http.ip_headercount;
  +    AXISTRACE1("came here1", 4);
  +	int count = soap->so.http.op_headercount;
  +    char tempMy[8];
  +    sprintf(tempMy, "%d", count);
  +    AXISTRACE2("count is:", tempMy, 4);    
   	Ax_header * temp = soap->so.http.ip_headers;
  -	soap->so.http.ip_headers = (Ax_header*)realloc(temp, 
  +    AXISTRACE1("came here2", 4);
  +    if(soap->so.http.op_headers)
  +        soap->so.http.op_headers = (Ax_header*)realloc(temp, 
   										(sizeof(Ax_header)*(count+1)));
  -	soap->so.http.ip_headers[count].headername = pchkey;
  -	soap->so.http.ip_headers[count].headervalue = pchvalue;
  -	soap->so.http.ip_headercount = count+1;
  +    else
  +        soap->so.http.op_headers = (Ax_header*)malloc((sizeof(Ax_header)*(count+1)));
  +        
  +    AXISTRACE1("came here3", 4);                                        
  +	soap->so.http.op_headers[count].headername = pchkey;
  +    AXISTRACE1("came here4", 4); 
  +	soap->so.http.op_headers[count].headervalue = pchvalue;
  +    AXISTRACE1("came here5", 4); 
  +	soap->so.http.op_headercount = count+1;
  +    
   
   	return 0;
   }
  -
   
   const char* get_header(const Ax_soapstream* soap,const char* pchkey)
   {
  
  
  
  No                   revision
  No                   revision
  1.7.2.2   +16 -2     ws-axis/c/src/engine/ClientAxisEngine.cpp
  
  Index: ClientAxisEngine.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/ClientAxisEngine.cpp,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- ClientAxisEngine.cpp	21 Nov 2003 13:01:10 -0000	1.7.2.1
  +++ ClientAxisEngine.cpp	11 Dec 2003 14:10:34 -0000	1.7.2.2
  @@ -5,6 +5,7 @@
   #include <axis/engine/ClientAxisEngine.h>
   #include <axis/wsdd/WSDDDeployment.h>
   #include <axis/engine/HandlerPool.h>
  +#include <axis/common/AxisTrace.h>
   
   extern WSDDDeployment* g_pWSDDDeployment;
   extern HandlerPool* g_pHandlerPool;
  @@ -126,8 +127,21 @@
   	
   	do 
   	{
  -		if (AXIS_SUCCESS != (Status = m_pSoap->transport.pSendTrtFunct(m_pSoap))) break;
  -		if (AXIS_SUCCESS != (Status = m_pSZ->SetOutputStream(m_pSoap))) break;
  +        if((Status = m_pSZ->SetOutputStream(m_pSoap)) == AXIS_SUCCESS)
  +        {
  +            AXISTRACE1("clientinvoke", 4);
  +            if (AXIS_SUCCESS != (Status = m_pSoap->transport.pSendTrtFunct(m_pSoap))) break;
  +            m_pSZ->flushSerializedBuffer();
  +        }
  +        else
  +        {
  +            if (AXIS_SUCCESS != (Status = m_pSoap->transport.pSendTrtFunct(m_pSoap)));
  +            break;
  +        }
  +
  +        
  +		
  +		//if (AXIS_SUCCESS != (Status = m_pSZ->SetOutputStream(m_pSoap))) break;
   		pMsg->setPastPivotState(true);
   		if (AXIS_SUCCESS != (Status = m_pSoap->transport.pGetTrtFunct(m_pSoap))) break;
   		if (AXIS_SUCCESS != (Status = m_pDZ->SetInputStream(m_pSoap))) break;
  
  
  
  1.10.2.3  +23 -4     ws-axis/c/src/engine/ServerAxisEngine.cpp
  
  Index: ServerAxisEngine.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/ServerAxisEngine.cpp,v
  retrieving revision 1.10.2.2
  retrieving revision 1.10.2.3
  diff -u -r1.10.2.2 -r1.10.2.3
  --- ServerAxisEngine.cpp	21 Nov 2003 13:01:10 -0000	1.10.2.2
  +++ ServerAxisEngine.cpp	11 Dec 2003 14:10:34 -0000	1.10.2.3
  @@ -30,6 +30,9 @@
   int ServerAxisEngine::Process(Ax_soapstream* soap) 
   {
   	int Status = 0;
  +    int intContentLength = 0;
  +    char strContentLength[8];
  +    
   //	AXIS_TRY
   		const WSDDService* pService = NULL;
   		string sSessionId = soap->sessionid;        
  @@ -160,10 +163,26 @@
   			Status = Invoke(m_pMsgData); //we generate response in the same way even if this has failed
   		}
   		while(0);
  -		//send any transoport information like http headers first
  -		soap->transport.pSendTrtFunct(soap);
  -		//Serialize
  -		m_pSZ->SetOutputStream(soap);
  +        //Serialize
  +        if((Status = m_pSZ->SetOutputStream(soap)) == AXIS_SUCCESS)
  +        {
  +            intContentLength = m_pSZ->GetContentLength();
  +            
  +            sprintf(strContentLength,"%d", intContentLength);
  +            AXISTRACE2("content length:", strContentLength, 4);
  +            set_header(soap, "Content-Length", strContentLength);
  +            AXISTRACE2("content length:", strContentLength, 4);
  +            //send any transoport information like http headers first
  +            soap->transport.pSendTrtFunct(soap);
  +            m_pSZ->flushSerializedBuffer();
  +        }
  +        else
  +        {
  +            //send any transoport information like http headers first
  +            soap->transport.pSendTrtFunct(soap);
  +            return Status;
  +        }
  +		
   
   		//Pool back the Service specific handlers
   		if (m_pSReqFChain) g_pHandlerPool->PoolHandlerChain(m_pSReqFChain, sSessionId);
  
  
  
  No                   revision
  No                   revision
  1.16.2.3  +2 -0      ws-axis/c/src/server/apache/mod_axis.c
  
  Index: mod_axis.c
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/server/apache/mod_axis.c,v
  retrieving revision 1.16.2.2
  retrieving revision 1.16.2.3
  diff -u -r1.16.2.2 -r1.16.2.3
  --- mod_axis.c	11 Dec 2003 13:53:05 -0000	1.16.2.2
  +++ mod_axis.c	11 Dec 2003 14:10:34 -0000	1.16.2.3
  @@ -88,6 +88,8 @@
   	sstr->transport.pSendTrtFunct = send_transport_information;
   	sstr->transport.pGetTrtFunct = send_transport_information; /*isn't there a get transport information function for apache module ?*/
   	sstr->trtype = APTHTTP;
  +    sstr->so.http.op_headercount = 0;
  +    sstr->so.http.op_headers = NULL;
   	/*req_rec is used as both input and output streams*/
   	sstr->str.ip_stream = req_rec;
   	sstr->str.op_stream = req_rec;
  
  
  
  No                   revision
  No                   revision
  1.17.2.5  +12 -2     ws-axis/c/src/soap/SoapDeSerializer.cpp
  
  Index: SoapDeSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapDeSerializer.cpp,v
  retrieving revision 1.17.2.4
  retrieving revision 1.17.2.5
  diff -u -r1.17.2.4 -r1.17.2.5
  --- SoapDeSerializer.cpp	11 Dec 2003 14:04:26 -0000	1.17.2.4
  +++ SoapDeSerializer.cpp	11 Dec 2003 14:10:34 -0000	1.17.2.5
  @@ -72,6 +72,7 @@
   #include <axis/soap/SoapDeSerializer.h>
   #include <axis/common/GDefine.h>
   #include <axis/common/Packet.h>
  +#include <axis/common/AxisTrace.h>
   
   #include <axis/soap/SoapInputSource.h>
   
  @@ -94,6 +95,7 @@
   {
   	delete m_pHandler;
   	delete m_pParser;
  +    delete m_hugebuffer;
   }
   
   int SoapDeSerializer::SetInputStream(const Ax_soapstream* pInputStream)
  @@ -108,8 +110,17 @@
   	int nChars = 0;
   	//request a huge number of bytes to get the whole soap request
   	//when pull parsing is used this should change
  +    int intBuffLen = HUGE_BUFFER_SIZE;
  +    const char* strBuffLen = get_header(pInputStream, "Content-Length");
  +    if(strBuffLen != NULL && strcmp(strBuffLen, "") != 0)
  +    {
  +        intBuffLen = atoi(strBuffLen);
  +    }
  +    
   	if (NULL != m_pInputStream->transport.pGetFunct)
  -		m_pInputStream->transport.pGetFunct(m_hugebuffer, HUGE_BUFFER_SIZE, &nChars, m_pInputStream->str.ip_stream);
  +        m_hugebuffer = (char*) malloc(intBuffLen + 10);
  +		m_pInputStream->transport.pGetFunct(m_hugebuffer, intBuffLen, &nChars, m_pInputStream->str.ip_stream);
  +    AXISTRACE2("buffer length is: ",strBuffLen, 4);        
   	//if no soap then quit
   	if (nChars <= 0) return AXIS_FAIL;
   	MemBufInputSource Input((const unsigned char*)m_hugebuffer, nChars , "bufferid");
  @@ -197,7 +208,6 @@
   
   int SoapDeSerializer::Init()
   {
  -	m_hugebuffer[0] = '\0';
   	m_pLastArrayParam = NULL;
   	m_pHandler->Init();
   	m_Status = AXIS_SUCCESS;
  
  
  
  1.30.2.2  +24 -7     ws-axis/c/src/soap/SoapSerializer.cpp
  
  Index: SoapSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.cpp,v
  retrieving revision 1.30.2.1
  retrieving revision 1.30.2.2
  diff -u -r1.30.2.1 -r1.30.2.2
  --- SoapSerializer.cpp	21 Nov 2003 13:01:13 -0000	1.30.2.1
  +++ SoapSerializer.cpp	11 Dec 2003 14:10:34 -0000	1.30.2.2
  @@ -77,6 +77,7 @@
   #include <axis/common/BasicTypeSerializer.h>
   #include <axis/soap/SoapKeywordMapping.h>
   #include <stdio.h>
  +#include <axis/common/AxisTrace.h>
   
   //////////////////////////////////////////////////////////////////////
   // Construction/Destruction
  @@ -87,11 +88,15 @@
   	m_pSoapEnvelope = NULL;
   	m_iSoapVersion = SOAP_VER_1_1;
   	m_pOutputStream = NULL;
  +    m_cSerializedBuffer = malloc(INITIAL_SERIALIZE_BUFFER_SIZE);
  +	m_iCurrentSerBufferSize = 0;
  +    m_iBufferSize = INITIAL_SERIALIZE_BUFFER_SIZE;
   }
   
   SoapSerializer::~SoapSerializer()
   {
   	if (m_pSoapEnvelope) delete m_pSoapEnvelope;
  +    if (m_cSerializedBuffer) delete m_cSerializedBuffer;
   }
   
   int SoapSerializer::setSoapEnvelope(SoapEnvelope *pSoapEnvelope)
  @@ -314,12 +319,16 @@
   
   	if(m_pSoapEnvelope) {
   		*this << "<?xml version='1.0' encoding='utf-8' ?>";
  -		iStatus= m_pSoapEnvelope->serialize(*this, (SOAP_VERSION)m_iSoapVersion);
  -		flushSerializedBuffer();
  +		iStatus= m_pSoapEnvelope->serialize(*this, (SOAP_VERSION)m_iSoapVersion);		
   	}
   	return iStatus;
   }
   
  +int SoapSerializer::GetContentLength()
  +{
  +    return m_iCurrentSerBufferSize;
  +}
  +
   int SoapSerializer::Init()
   {
   	//initializing the members of the class. This is needed since
  @@ -336,8 +345,9 @@
   	m_pSoapEnvelope->setSoapBody(new SoapBody());
   
   	iCounter=0;
  -	m_iCurrentSerBufferSize=0;
  -	m_cSerializedBuffer[0]='\0'; //make buffer to empty content (as a char*)
  +	m_iCurrentSerBufferSize = 0;
  +    if(m_cSerializedBuffer)
  +        m_cSerializedBuffer[0]='\0'; //make buffer to empty content (as a char*)
   	return AXIS_SUCCESS;
   }
   
  @@ -361,10 +371,11 @@
   IWrapperSoapSerializer& SoapSerializer::operator <<(const AxisChar* cSerialized)
   {
   	int iTmpSerBufferSize = strlen(cSerialized);
  -	if((m_iCurrentSerBufferSize + iTmpSerBufferSize)>= SERIALIZE_BUFFER_SIZE) 
  +	if((m_iCurrentSerBufferSize + iTmpSerBufferSize)>= m_iBufferSize) 
   	{
  -		flushSerializedBuffer();		
  -	}
  +        m_iBufferSize *= 2;
  +        m_cSerializedBuffer = realloc(m_cSerializedBuffer, m_iBufferSize);
  +	}    
   	strcat(m_cSerializedBuffer, cSerialized);
   	m_iCurrentSerBufferSize += iTmpSerBufferSize;
   	return *this;
  @@ -386,10 +397,16 @@
   int SoapSerializer::flushSerializedBuffer()
   {
   	//sendSoapResponse(m_cSerializedBuffer);
  +    AXISTRACE1("flushSerializedBuffer1", 4);
   	if (NULL != m_pOutputStream->transport.pSendFunct)
  +    {
  +        AXISTRACE1("flushSerializedBuffer2", 4);    
   		m_pOutputStream->transport.pSendFunct(m_cSerializedBuffer, m_pOutputStream->str.op_stream);
  +    }
  +    
   	m_cSerializedBuffer[0]= '\0';
   	m_iCurrentSerBufferSize=0;
  +    
   	return AXIS_SUCCESS;
   }
   
  
  
  
  No                   revision
  No                   revision
  1.23.2.4  +1 -1      ws-axis/c/src/wsdd/WSDDDocument.cpp
  
  Index: WSDDDocument.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdd/WSDDDocument.cpp,v
  retrieving revision 1.23.2.3
  retrieving revision 1.23.2.4
  diff -u -r1.23.2.3 -r1.23.2.4
  --- WSDDDocument.cpp	21 Nov 2003 13:01:13 -0000	1.23.2.3
  +++ WSDDDocument.cpp	11 Dec 2003 14:10:35 -0000	1.23.2.4
  @@ -94,7 +94,7 @@
   
   int WSDDDocument::ParseDocument(const AxisChar* sWSDD)
   {
  -//	AXISTRACE1("inside ParseDocument\n");
  +	AXISTRACE1("inside ParseDocument\n", 2);
   	try
   	{
   		SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();