susantha    2003/08/16 01:15:47

  Modified:    c/src/common Debug.cpp GDefine.cpp GDefine.h Packet.h
               c/src/engine Axis.cpp HandlerLoader.cpp Main.c
               c/src/server/apache mod_axis.c
               c/src/soap Attribute.cpp Attribute.h SoapEnvVersions.h
                        SoapEnvelope.cpp SoapEnvelope.h SoapSerializer.cpp
                        SoapSerializer.h
               c/src/wsdd WSDDDocument.cpp
  Log:
  some improvements
  
  Revision  Changes    Path
  1.6       +1 -1      xml-axis/c/src/common/Debug.cpp
  
  Index: Debug.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/Debug.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Debug.cpp 29 Jul 2003 12:09:08 -0000      1.5
  +++ Debug.cpp 16 Aug 2003 08:15:47 -0000      1.6
  @@ -10,7 +10,7 @@
   
   Debug::Debug()
   {
  -  sFileName = "/usr/local/axiscpp/axis/logs/Debug";
  +  sFileName = "E:\\Program Files\\Apache Group\\Apache\\Axis\\logs\\Debug.txt";
     if(!sFileName.empty())
     {
       FileName = sFileName.c_str();
  
  
  
  1.2       +8 -0      xml-axis/c/src/common/GDefine.cpp
  
  Index: GDefine.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/GDefine.cpp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- GDefine.cpp       15 Aug 2003 04:31:25 -0000      1.1
  +++ GDefine.cpp       16 Aug 2003 08:15:47 -0000      1.2
  @@ -6,6 +6,9 @@
   #include <unistd.h>
   #endif
   
  +#include "../soap/Attribute.h"
  +#include "../soap/SoapEnvVersions.h"
  +
   void Ax_Sleep(int nTime)
   {
   #ifdef WIN32
  @@ -13,4 +16,9 @@
   #else
                sleep(0);
   #endif
  +}
  +
  +void ModuleInitialize()
  +{
  +
   }
  
  
  
  1.4       +1 -0      xml-axis/c/src/common/GDefine.h
  
  Index: GDefine.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/GDefine.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GDefine.h 15 Aug 2003 04:31:25 -0000      1.3
  +++ GDefine.h 16 Aug 2003 08:15:47 -0000      1.4
  @@ -73,5 +73,6 @@
   #define SOAPACTIONHEADER "SOAPAction"
   
   extern void Ax_Sleep(int);
  +extern void ModuleInitialize();
   
   #endif //__GDEFINE_INCLUDED__
  
  
  
  1.6       +1 -1      xml-axis/c/src/common/Packet.h
  
  Index: Packet.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/common/Packet.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Packet.h  14 Aug 2003 05:10:04 -0000      1.5
  +++ Packet.h  16 Aug 2003 08:15:47 -0000      1.6
  @@ -82,7 +82,7 @@
   
        //This function should be implemented by module authors
        //Allows to send pieces of soap response the transport handler
  -     int send_response_bytes(char* res, void* opstream);
  +     int send_response_bytes(const char* res, void* opstream);
   
        //This function should be implemented by module authors
        //Allows axis to get pieces of the request as they come to the transport 
listener
  
  
  
  1.8       +4 -0      xml-axis/c/src/engine/Axis.cpp
  
  Index: Axis.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/engine/Axis.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Axis.cpp  14 Aug 2003 14:03:14 -0000      1.7
  +++ Axis.cpp  16 Aug 2003 08:15:47 -0000      1.8
  @@ -126,6 +126,7 @@
                                                send_response_bytes("</tr>", 
str->str.op_stream);
                                        }
                                        send_response_bytes("</table></body></html>", 
str->str.op_stream);
  +                                     Status = SUCCESS;
                                }
                                else 
                                {
  @@ -134,6 +135,7 @@
                                        if((WsddFile = 
fopen(sServiceName.c_str(),"r"))==NULL)
                                        {
                                                send_response_bytes("<h3>Url not 
available</h3>", str->str.op_stream);
  +                                             Status = SUCCESS;
                                                //handle the error
                                        }
                                        else
  @@ -160,10 +162,12 @@
   
   extern "C" int initialize_module()
   {
  +     DEBUG1("inside initialize_module\n");
        TypeMapping::Initialize();
        URIMapping::Initialize();
        SoapFault::initialize();
        XMLPlatformUtils::Initialize();
  +     ModuleInitialize();
        string ConfFile = WSDDFILEPATH;
        if (SUCCESS != g_WSDDDeployment.LoadWSDD(ConfFile)) return FAIL;
        return SUCCESS;
  
  
  
  1.5       +1 -0      xml-axis/c/src/engine/HandlerLoader.cpp
  
  Index: HandlerLoader.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/engine/HandlerLoader.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HandlerLoader.cpp 13 Aug 2003 14:07:47 -0000      1.4
  +++ HandlerLoader.cpp 16 Aug 2003 08:15:47 -0000      1.5
  @@ -129,6 +129,7 @@
   
   int HandlerLoader::CreateHandler(BasicHandler** pHandler, int nLibId)
   {
  +     DEBUG1("inside CreateHandler\n");
        lock();
        *pHandler = NULL;
        HandlerInformation* pHandlerInfo = NULL;
  
  
  
  1.8       +7 -7      xml-axis/c/src/engine/Main.c
  
  Index: Main.c
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/engine/Main.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Main.c    14 Aug 2003 14:03:14 -0000      1.7
  +++ Main.c    16 Aug 2003 08:15:47 -0000      1.8
  @@ -197,20 +197,20 @@
        printf("soap request :\n %s\n", ip);
   
        initialize_module();
  -     for (xx =0; xx < 100 ; xx++)
  +     for (xx =0; xx < 1000 ; xx++)
                process_request(str);   
   
        return 0;
   }
   
  -int send_response_bytes(char * res, void* pOutputStream) {
  -
  +int send_response_bytes(const char * res, void* pOutputStream) 
  +{
   //   printf("sending SOAP response : \n%s\n", res);
        return 0;
   }
   
  -int get_request_bytes(char * req, int reqsize, int* retsize) {
  -
  +int get_request_bytes(char * req, int reqsize, int* retsize) 
  +{
        req[0]= '\0';
        strcat(req, ip);
   //   printf("strlen(ip)%d", strlen(ip));
  @@ -218,7 +218,7 @@
        return 0;
   }
   
  -int send_transport_information(Ax_soapstream* sSoapstream) {
  -
  +int send_transport_information(Ax_soapstream* sSoapstream) 
  +{
        return 0;
   }
  
  
  
  1.5       +1 -1      xml-axis/c/src/server/apache/mod_axis.c
  
  Index: mod_axis.c
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/server/apache/mod_axis.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- mod_axis.c        13 Aug 2003 14:07:56 -0000      1.4
  +++ mod_axis.c        16 Aug 2003 08:15:47 -0000      1.5
  @@ -39,7 +39,7 @@
        initialize_module();
   }
   
  -int send_response_bytes(char* res, void* opstream)
  +int send_response_bytes(const char* res, void* opstream)
   {
        ap_rputs(res, (request_rec*)opstream);
        return 0;
  
  
  
  1.5       +2 -2      xml-axis/c/src/soap/Attribute.cpp
  
  Index: Attribute.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/Attribute.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Attribute.cpp     21 Jul 2003 14:21:09 -0000      1.4
  +++ Attribute.cpp     16 Aug 2003 08:15:47 -0000      1.5
  @@ -114,7 +114,7 @@
   /*
    *
    */
  -int Attribute::serialize(SoapSerializer& pSZ)
  +int Attribute::serialize(SoapSerializer& pSZ) const
   {    
        int intStatus= FAIL;
   
  @@ -156,7 +156,7 @@
   }
   */
   
  -bool Attribute::isSerializable()
  +bool Attribute::isSerializable() const
   {
        bool bStatus= true;
   
  
  
  
  1.5       +2 -2      xml-axis/c/src/soap/Attribute.h
  
  Index: Attribute.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/Attribute.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Attribute.h       21 Jul 2003 14:21:09 -0000      1.4
  +++ Attribute.h       16 Aug 2003 08:15:47 -0000      1.5
  @@ -80,14 +80,14 @@
   class Attribute  
   {
   private:     
  -     bool isSerializable();
  +     bool isSerializable() const;
        string m_localname;
        string m_prefix;
        string m_uri;
        string m_value;
        //string m_strAttrSerialized;
   public:              
  -     int serialize(SoapSerializer& pSZ);
  +     int serialize(SoapSerializer& pSZ) const;
        //int serialize(string&);
        Attribute();    
        Attribute(const string &localname, const string &prefix, const string &uri, 
const string &value);
  
  
  
  1.3       +15 -3     xml-axis/c/src/soap/SoapEnvVersions.h
  
  Index: SoapEnvVersions.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapEnvVersions.h,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SoapEnvVersions.h 27 Jun 2003 04:23:15 -0000      1.2
  +++ SoapEnvVersions.h 16 Aug 2003 08:15:47 -0000      1.3
  @@ -68,6 +68,8 @@
   #ifndef __SOAPENVVERSIONS_H_INCLUDED___
   #define __SOAPENVVERSIONS_H_INCLUDED___
   
  +#include "Attribute.h"
  +
   /*
    *Here SKW stands for SoapKeyWord. This is a internal naming convension
    * for Axis C++.
  @@ -100,6 +102,9 @@
        char* pchEnvelopeNamespaceUri;
        char* pchEnvelopePrefix;
        char* pcharWords[SOAP_WORDS_LAST];
  +     const Attribute* pEnv;
  +     const Attribute* pXsi;
  +     const Attribute* pXsd;
   };
   
   static SoapEnvVersionsStruct g_sObjSoapEnvVersionsStruct[VERSION_LAST]=
  @@ -121,7 +126,11 @@
   /*SKW_FAULT_ACTOR*/          "faultactor",
   /*SKW_DETAIL*/                       "detail",
   /*SKW_MULTIREF*/             "multiRef"
  -                     } 
  +                     },
  +                     //attributes for soap 1.1 envelope
  +                     new 
Attribute("SOAP-ENV","xmlns","","http://schemas.xmlsoap.org/soap/envelope/";),
  +                     new 
Attribute("xsi","xmlns","","http://www.w3.org/2001/XMLSchema-instance";),
  +                     new 
Attribute("xsd","xmlns","","http://www.w3.org/2001/XMLSchema";),
                },
   
                //SOAP_VER_1_2
  @@ -141,8 +150,11 @@
   /*SKW_FAULT_ACTOR*/          "Role",
   /*SKW_DETAIL*/                       "Detail",
   /*SKW_MULTIREF*/             "multiRef"
  -                     } 
  +                     },
  +                     //attributes for soap 1.2 envelope
  +                     new 
Attribute("env","xmlns","","http://www.w3.org/2003/05/soap-envelope";),
  +                     new 
Attribute("xsi","xmlns","","http://www.w3.org/2001/XMLSchema-instance";),
  +                     new 
Attribute("xsd","xmlns","","http://www.w3.org/2001/XMLSchema";),
                }
        };      
  -
   #endif //__SOAPENVVERSIONS_H_INCLUDED___
  
  
  
  1.4       +20 -11    xml-axis/c/src/soap/SoapEnvelope.cpp
  
  Index: SoapEnvelope.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapEnvelope.cpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SoapEnvelope.cpp  15 Jul 2003 07:05:06 -0000      1.3
  +++ SoapEnvelope.cpp  16 Aug 2003 08:15:47 -0000      1.4
  @@ -126,26 +126,19 @@
   
   int SoapEnvelope::serialize(SoapSerializer& pSZ, SOAP_VERSION eSoapVersion)
   {    
  -     
        int iStatus= SUCCESS;
  -
  -     do {
  -                                             
  -             pSZ << "<" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pchEnvelopePrefix << ":" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pcharWords[SKW_ENVELOPE];         
  -                             
  -
  +     do {                    
  +             pSZ << "<" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pchEnvelopePrefix << ":" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pcharWords[SKW_ENVELOPE];                 
  +             serializeStandardNamespaceDecl(pSZ);
                serializeNamespaceDecl(pSZ);
                serializeAttributes(pSZ);
  -             
                pSZ << ">";
  -
                if(m_pSoapHeader!=NULL) {
                        iStatus= m_pSoapHeader->serialize(pSZ, eSoapVersion);
                        if(iStatus == FAIL) {
                                break;
                        }
                }
  -
                if(m_pSoapBody!=NULL) {
                        iStatus= m_pSoapBody->serialize(pSZ, eSoapVersion);
                        if(iStatus == FAIL) {
  @@ -157,7 +150,6 @@
                }
                                
                pSZ << "</" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pchEnvelopePrefix << ":" << 
g_sObjSoapEnvVersionsStruct[eSoapVersion].pcharWords[SKW_ENVELOPE] << ">";
  -
                pSZ.flushSerializedBuffer();
        } while(0);
   
  @@ -293,5 +285,22 @@
   {
        m_sPrefix= prefix;
   
  +     return SUCCESS;
  +}
  +
  +int SoapEnvelope::addStandardNamespaceDecl(const Attribute *pAttribute)
  +{
  +     m_StandardNamespaceDecls.push_back(pAttribute);
  +     return SUCCESS;
  +}
  +
  +int SoapEnvelope::serializeStandardNamespaceDecl(SoapSerializer &pSZ)
  +{
  +     list<const Attribute*>::iterator itCurrNamespaceDecl= 
m_StandardNamespaceDecls.begin();
  +     while(itCurrNamespaceDecl != m_StandardNamespaceDecls.end()) 
  +     {                       
  +             (*itCurrNamespaceDecl)->serialize(pSZ);
  +             itCurrNamespaceDecl++;          
  +     }       
        return SUCCESS;
   }
  
  
  
  1.4       +3 -0      xml-axis/c/src/soap/SoapEnvelope.h
  
  Index: SoapEnvelope.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapEnvelope.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SoapEnvelope.h    15 Jul 2003 07:05:06 -0000      1.3
  +++ SoapEnvelope.h    16 Aug 2003 08:15:47 -0000      1.4
  @@ -81,6 +81,8 @@
   friend class SoapSerializer;
   
   private:
  +     int serializeStandardNamespaceDecl(SoapSerializer& pSZ);
  +     int addStandardNamespaceDecl(const Attribute* pAttribute);
        int serializeNamespaceDecl(SoapSerializer& pSZ);
        //int serializeNamespaceDecl(string&);
        int serializeAttributes(SoapSerializer& pSZ);
  @@ -90,6 +92,7 @@
        //string m_strEnvelopSerialized;
        list<Attribute*> m_attributes;
        list<Attribute*> m_namespaceDecls;
  +     list<const Attribute*> m_StandardNamespaceDecls;
        string m_sPrefix;       
   
   public:      
  
  
  
  1.13      +9 -10     xml-axis/c/src/soap/SoapSerializer.cpp
  
  Index: SoapSerializer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SoapSerializer.cpp        13 Aug 2003 14:11:10 -0000      1.12
  +++ SoapSerializer.cpp        16 Aug 2003 08:15:47 -0000      1.13
  @@ -221,6 +221,7 @@
   int SoapSerializer::setSoapVersion(SOAP_VERSION nSoapVersion)
   {
        //here the default namespaces of the SoapEnvelop should be added and 
intialized as well.
  +/*
        Attribute* pNS = new 
Attribute(g_sObjSoapEnvVersionsStruct[nSoapVersion].pchEnvelopePrefix,
          
"xmlns","",g_sObjSoapEnvVersionsStruct[nSoapVersion].pchEnvelopeNamespaceUri);
        m_pSoapEnvelope->addNamespaceDecl(pNS);
  @@ -229,7 +230,10 @@
        m_pSoapEnvelope->addNamespaceDecl(pNS);
        pNS = new 
Attribute("xsi","xmlns","","http://www.w3.org/2001/XMLSchema-instance";);
        m_pSoapEnvelope->addNamespaceDecl(pNS);
  -
  +*/
  +     
m_pSoapEnvelope->addStandardNamespaceDecl(g_sObjSoapEnvVersionsStruct[nSoapVersion].pEnv);
  +     
m_pSoapEnvelope->addStandardNamespaceDecl(g_sObjSoapEnvVersionsStruct[nSoapVersion].pXsd);
  +     
m_pSoapEnvelope->addStandardNamespaceDecl(g_sObjSoapEnvVersionsStruct[nSoapVersion].pXsi);
        return SUCCESS;
   }
   
  @@ -242,15 +246,13 @@
   
   IWrapperSoapSerializer& SoapSerializer::operator <<(const char *cSerialized)
   {
  -     int iTmpSerBufferSize= strlen(cSerialized);
  -     if((m_iCurrentSerBufferSize+iTmpSerBufferSize)>1023) {
  +     int iTmpSerBufferSize = strlen(cSerialized);
  +     if((m_iCurrentSerBufferSize + iTmpSerBufferSize)>= SERIALIZE_BUFFER_SIZE) 
  +     {
                flushSerializedBuffer();                
        }
        strcat(m_cSerializedBuffer, cSerialized);
  -     //cout<<m_cSerializedBuffer<<"END@@";
  -
  -     m_iCurrentSerBufferSize+= iTmpSerBufferSize;
  -
  +     m_iCurrentSerBufferSize += iTmpSerBufferSize;
        return *this;
        //call the ruputs to send this soap response
        //ruputs(m_cSerializedBuffer);
  @@ -258,13 +260,10 @@
   
   int SoapSerializer::flushSerializedBuffer()
   {
  -     //cout<<"++++++++++++++++"<<"flushed"<<endl;
  -     //cout<<"++++++++++++++++"<<m_cSerializedBuffer<<endl;
        //sendSoapResponse(m_cSerializedBuffer);
        send_response_bytes(m_cSerializedBuffer, m_pOutputStream);
        m_cSerializedBuffer[0]= '\0';
        m_iCurrentSerBufferSize=0;
  -
        return SUCCESS;
   }
   
  
  
  
  1.11      +3 -1      xml-axis/c/src/soap/SoapSerializer.h
  
  Index: SoapSerializer.h
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/soap/SoapSerializer.h,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SoapSerializer.h  13 Aug 2003 14:11:10 -0000      1.10
  +++ SoapSerializer.h  16 Aug 2003 08:15:47 -0000      1.11
  @@ -77,6 +77,8 @@
   #include "../common/BasicTypeSerializer.h"
   #include "SoapEnvVersions.h"
   
  +#define SERIALIZE_BUFFER_SIZE 1024
  +
   class SoapEnvelope;
   class SoapHeader;
   class SoapMethod;
  @@ -91,7 +93,7 @@
        char cCounter[64];
        SoapEnvelope* m_pSoapEnvelope;  
        int m_iSoapVersion;
  -     char m_cSerializedBuffer[1024];
  +     char m_cSerializedBuffer[SERIALIZE_BUFFER_SIZE];
        int m_iCurrentSerBufferSize;
   public:
        ISoapMethod* createSoapMethod();        
  
  
  
  1.6       +1 -0      xml-axis/c/src/wsdd/WSDDDocument.cpp
  
  Index: WSDDDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-axis/c/src/wsdd/WSDDDocument.cpp,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSDDDocument.cpp  13 Aug 2003 13:31:42 -0000      1.5
  +++ WSDDDocument.cpp  16 Aug 2003 08:15:47 -0000      1.6
  @@ -96,6 +96,7 @@
   
   int WSDDDocument::ParseDocument(const string& sWSDD)
   {
  +     DEBUG1("inside ParseDocument\n");
        try
        {
                SAX2XMLReader * parser = XMLReaderFactory::createXMLReader();
  
  
  

Reply via email to