You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2004/11/02 14:53:32 UTC

cvs commit: ws-axis/c/tools/trace/org/apache/axis/tracetool Tracer.java

whitlock    2004/11/02 05:53:32

  Modified:    c/include/axis/client Stub.hpp
               c/include/axis/server Attribute.h Attribute.hpp
                        IHeaderBlock.hpp SoapEnvVersions.hpp
               c/src/common AxisTrace.cpp
               c/src/engine/client Stub.cpp
               c/src/soap Attribute.cpp ComplexElement.cpp ComplexElement.h
                        HeaderBlock.cpp HeaderBlock.h SoapBody.cpp
                        SoapDeSerializer.cpp SoapEnvelope.cpp
                        SoapHeader.cpp SoapHeader.h SoapKeywordMapping.cpp
                        SoapKeywordMapping.h SoapMethod.cpp
                        SoapSerializer.h
               c/tools/trace/org/apache/axis/tracetool Tracer.java
  Added:       c/src/soap Attribute.h
  Log:
  Change Attribute.h from external to internal
  
  Revision  Changes    Path
  1.4       +7 -7      ws-axis/c/include/axis/client/Stub.hpp
  
  Index: Stub.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/client/Stub.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Stub.hpp	29 Oct 2004 09:53:35 -0000	1.3
  +++ Stub.hpp	2 Nov 2004 13:53:30 -0000	1.4
  @@ -62,7 +62,7 @@
   #define _STUB_H____OF_AXIS_INCLUDED_
   
   #include <axis/client/Call.hpp>
  -#include <axis/server/Attribute.hpp>
  +#include <axis/IAttribute.hpp>
   #include <vector>
   
   using namespace std;
  @@ -409,7 +409,7 @@
       * @return First SOAP method attribute pointer. If there are no SOAP method 
       * attributes set, returns NULL.
       */
  -    Attribute* getFirstSOAPMethodAttribute();
  +    IAttribute* getFirstSOAPMethodAttribute();
   
     /**
       * Iterator for SOAP method attributes
  @@ -423,7 +423,7 @@
       * @return Next SOAP method attribute pointer. If there are no SOAP method 
       * attributes set or if iterator is at the end of the list, returns NULL.
       */
  -    Attribute* getNextSOAPMethodAttribute();
  +    IAttribute* getNextSOAPMethodAttribute();
   
     /**
       * Accessor for SOAP method attributes
  @@ -442,7 +442,7 @@
       * @return Current SOAP method attribute pointer. If there are no SOAP method 
       * attribute set or if iterator is at the end of the list, returns NULL.
       */
  -    Attribute* getCurrentSOAPMethodAttribute();
  +    IAttribute* getCurrentSOAPMethodAttribute();
       
     /**
       * Deletes the SOAP method attribute currently pointed to by 
  @@ -469,7 +469,7 @@
       *
       * @param pAttribute Pointer of Attribute to be deleted
       */
  -    void deleteSOAPMethodAttribute(Attribute* pAttribute);
  +    void deleteSOAPMethodAttribute(IAttribute* pAttribute);
   
     /**
       * Set transport timeout.
  @@ -561,12 +561,12 @@
     /**
       * List of SOAPMethod Attributes
       */
  -    vector <Attribute*> m_vSOAPMethodAttributes;
  +    vector <IAttribute*> m_vSOAPMethodAttributes;
   
     /**
       * Trasport keys iterator
       */
  -    vector <Attribute*>::iterator m_viCurrentSOAPMethodAttribute;
  +    vector <IAttribute*>::iterator m_viCurrentSOAPMethodAttribute;
   
     /**
       * Timeout in seconds
  
  
  
  1.20      +1 -1      ws-axis/c/include/axis/server/Attribute.h
  
  Index: Attribute.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/Attribute.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Attribute.h	28 Oct 2004 11:27:18 -0000	1.19
  +++ Attribute.h	2 Nov 2004 13:53:30 -0000	1.20
  @@ -13,4 +13,4 @@
    *   See the License for the specific language governing permissions and
    *   limitations under the License.
    */
  -#error "Please include Attribute.hpp instead"
  +#error "Please include IAttribute.hpp instead"
  
  
  
  1.4       +1 -71     ws-axis/c/include/axis/server/Attribute.hpp
  
  Index: Attribute.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/Attribute.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Attribute.hpp	29 Oct 2004 15:34:55 -0000	1.3
  +++ Attribute.hpp	2 Nov 2004 13:53:30 -0000	1.4
  @@ -13,74 +13,4 @@
    *   See the License for the specific language governing permissions and
    *   limitations under the License.
    */
  -
  - /**
  - * @file Attribute.hpp
  - *
  - *
  - */
  - 
  -#if !defined(_ATTRIBUTE_H____OF_AXIS_INCLUDED_)
  -#define _ATTRIBUTE_H____OF_AXIS_INCLUDED_
  -
  -#include "GDefine.hpp"
  -#include <axis/IAttribute.hpp>
  -#include <list>
  -#include <string>
  -
  -AXIS_CPP_NAMESPACE_START
  -using namespace std;
  -
  -class SoapSerializer;
  -
  -/**
  - *   @class Attribute
  - *   @brief interface for the Attribute class.
  - *
  - *   @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
  - *   @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
  - *   @author Susantha Kumara (susantha@opensource.lk, skumara@virtusa.com)
  - *
  - */
  -
  -class Attribute : public IAttribute
  -{
  -public:        
  -#ifdef UNIT_TESTING_ON
  -    int initializeForTesting();
  -#endif
  -    int serialize(SoapSerializer& pSZ) const;
  -    int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack);
  -
  -    Attribute();    
  -    Attribute(const AxisChar* localname, const AxisChar* prefix, 
  -        const AxisChar* uri, const AxisChar* value);
  -    Attribute(const AxisChar* localname, const AxisChar* prefix, 
  -        const AxisChar* value);
  -    Attribute(const Attribute& rCopy);   
  -    Attribute* clone(); 
  -    virtual ~Attribute();
  -
  -    void setValue(const AxisChar* value);
  -    void setUri(const AxisChar* uri);
  -    void setPrefix(const AxisChar* prefix);
  -    void setLocalName(const AxisChar* localname);    
  -
  -    const AxisChar* getValue();
  -    const AxisChar* getUri();
  -    const AxisChar* getPrefix();
  -    const AxisChar* getLocalName();
  -
  -private:    
  -    bool isSerializable() const;
  -    AxisString m_localname;
  -    AxisString m_prefix;
  -    AxisString m_uri;
  -    AxisString m_value;
  -
  -};
  -
  -AXIS_CPP_NAMESPACE_END
  -
  -#endif
  -
  +#error "Please include IAttribute.hpp instead"
  
  
  
  1.4       +3 -9      ws-axis/c/include/axis/server/IHeaderBlock.hpp
  
  Index: IHeaderBlock.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/IHeaderBlock.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- IHeaderBlock.hpp	29 Oct 2004 15:34:55 -0000	1.3
  +++ IHeaderBlock.hpp	2 Nov 2004 13:53:30 -0000	1.4
  @@ -21,12 +21,6 @@
   #include "SoapEnvVersions.hpp"
   #include <axis/IAttribute.hpp>
   
  -AXIS_CPP_NAMESPACE_START
  -
  -class Attribute;
  -
  -AXIS_CPP_NAMESPACE_END
  -
   enum HEADER_BLOCK_STD_ATTR_TYPE 
   {   ROLE_NEXT=1, ROLE_NONE=2, 
       ROLE_ULTIMATE_RECEIVER=3, 
  @@ -178,7 +172,7 @@
        *
        * @return A pointer to the created standard Attribute will be returned.
        */
  -    virtual Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
  +    virtual IAttribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
           eStdAttrType, SOAP_VERSION eSOAP_VERSION) =0;
   
       /**
  @@ -191,7 +185,7 @@
         *
         * @return A pointer to the created Attribute will be returned.
         */
  -    virtual Attribute* createAttribute(const AxisChar* localname, 
  +    virtual IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, 
           const AxisChar* uri, const AxisChar* value) = 0;
   
  @@ -204,7 +198,7 @@
         *
         * @return A pointer to the created Attribute will be returned.
         */
  -    virtual Attribute* createAttribute(const AxisChar *localname, 
  +    virtual IAttribute* createAttribute(const AxisChar *localname, 
           const AxisChar *prefix, const AxisChar *value) = 0;
        /**
         * Gets an Attribute from the HeaderBlock.
  
  
  
  1.3       +0 -6      ws-axis/c/include/axis/server/SoapEnvVersions.hpp
  
  Index: SoapEnvVersions.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/SoapEnvVersions.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SoapEnvVersions.hpp	29 Oct 2004 15:34:55 -0000	1.2
  +++ SoapEnvVersions.hpp	2 Nov 2004 13:53:30 -0000	1.3
  @@ -62,12 +62,6 @@
       VERSION_LAST
   } SOAP_VERSION;
   
  -AXIS_CPP_NAMESPACE_START
  -
  -class Attribute;
  -
  -AXIS_CPP_NAMESPACE_END
  -
   struct SoapEnvVersionsStruct 
   {    
       const AxisChar* pchNamespaceUri;
  
  
  
  1.37      +15 -8     ws-axis/c/src/common/AxisTrace.cpp
  
  Index: AxisTrace.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisTrace.cpp,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- AxisTrace.cpp	2 Nov 2004 10:03:11 -0000	1.36
  +++ AxisTrace.cpp	2 Nov 2004 13:53:31 -0000	1.37
  @@ -294,10 +294,13 @@
           traceLine("Unknown exception caught during trace entry");
       }
   
  -	string name = className;
  -	name += "::";
  -	name += methodName;
  -	m_stack.push(name);
  +    string name;
  +    if (NULL!=className) {
  +        name = className;
  +	  name += "::";
  +	  name += methodName;
  +    } else name = methodName;
  +    m_stack.push(name);
   }
   
   void AxisTrace::traceExit(const char *className, const char *methodName, 
  @@ -307,9 +310,12 @@
   
   	try {
   		// Careful here in case entries and exits don't match
  -		string name = className;
  -		name += "::";
  -		name += methodName;
  +		string name;
  +            if (NULL!=className) {
  +                name = className;
  +		    name += "::";
  +		    name += methodName;
  +            } else name = methodName;
   		while (m_stack.size()>0 && name!=m_stack.top()) m_stack.pop();
   		if (m_stack.size()>0) m_stack.pop();
   
  @@ -394,6 +400,7 @@
               pcValue = *((char**)pcValue);
   		sprintf(prim,"%p ",pcValue);	
   		line += prim;	
  +            if (NULL==pcValue) return;
   		// no break!
   	
   	case TRACETYPE_DATA:	
  @@ -421,7 +428,7 @@
   		try {
                     pcValue = *((char**)pcValue);
   			line += "\"";	
  -			line += pcValue;	
  +			line += ((NULL==pcValue)?"<null>":pcValue);	
   			line += "\"";	
   		} catch (...) {
   			line += "<BADPOINTER>";
  
  
  
  1.21      +11 -9     ws-axis/c/src/engine/client/Stub.cpp
  
  Index: Stub.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/engine/client/Stub.cpp,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Stub.cpp	29 Oct 2004 09:53:35 -0000	1.20
  +++ Stub.cpp	2 Nov 2004 13:53:31 -0000	1.21
  @@ -42,6 +42,7 @@
   #include "../../transport/SOAPTransport.h"
   #include <axis/server/AxisWrapperAPI.hpp>
   #include "../../soap/SoapSerializer.h"
  +#include "../../soap/Attribute.h"
   
   AXIS_CPP_NAMESPACE_USE
   
  @@ -284,7 +285,7 @@
   {
       //Samisa
       //Check if there is an attribute with the same local name is already set
  -    Attribute* pAttribute = this->getFirstSOAPMethodAttribute();
  +    IAttribute* pAttribute = this->getFirstSOAPMethodAttribute();
       while( pAttribute )
       {
           if( strcmp(pAttribute->getLocalName(), pLocalname) == 0 )
  @@ -304,7 +305,7 @@
       m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
   }
   
  -Attribute* Stub::getFirstSOAPMethodAttribute()
  +IAttribute* Stub::getFirstSOAPMethodAttribute()
   {
       m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
       if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
  @@ -313,7 +314,7 @@
           return (*m_viCurrentSOAPMethodAttribute);
   }
   
  -Attribute* Stub::getNextSOAPMethodAttribute()
  +IAttribute* Stub::getNextSOAPMethodAttribute()
   {
       //already at the end?
       if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
  @@ -327,7 +328,7 @@
           return (*m_viCurrentSOAPMethodAttribute);
   }
   
  -Attribute* Stub::getCurrentSOAPMethodAttribute()
  +IAttribute* Stub::getCurrentSOAPMethodAttribute()
   {
       if (m_viCurrentSOAPMethodAttribute == m_vSOAPMethodAttributes.end())
           return NULL;
  @@ -345,7 +346,7 @@
       {
          for (unsigned int i = 0; i < m_vSOAPMethodAttributes.size(); i++)
   	   {
  -           pSerializer->setSOAPMethodAttribute(m_vSOAPMethodAttributes[i]->clone());
  +           pSerializer->setSOAPMethodAttribute(((Attribute*)m_vSOAPMethodAttributes[i])->clone());
   	   }
       }	
   }
  @@ -360,9 +361,9 @@
       }
   }
   
  -void Stub::deleteSOAPMethodAttribute(Attribute* pAttribute)
  +void Stub::deleteSOAPMethodAttribute(IAttribute* pAttribute)
   {
  -    vector <Attribute*>::iterator currentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
  +    vector <IAttribute*>::iterator currentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
       bool bDone = false;
       while( !bDone && currentSOAPMethodAttribute != m_vSOAPMethodAttributes.end())
       {
  @@ -378,9 +379,10 @@
   }
   
   
  -void Stub::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, const AxisChar *pUri, const AxisChar *pValue)
  +void Stub::setSOAPMethodAttribute(const AxisChar *pLocalname, const AxisChar *pPrefix, 
  +                                  const AxisChar *pUri, const AxisChar *pValue)
   {
  -    Attribute* pAttribute = new Attribute(pLocalname, pPrefix, pUri, pValue);
  +    IAttribute* pAttribute = new Attribute(pLocalname, pPrefix, pUri, pValue);
   	m_vSOAPMethodAttributes.push_back(pAttribute);
       m_viCurrentSOAPMethodAttribute = m_vSOAPMethodAttributes.begin();
   }
  
  
  
  1.27      +1 -2      ws-axis/c/src/soap/Attribute.cpp
  
  Index: Attribute.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/Attribute.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Attribute.cpp	29 Oct 2004 15:34:57 -0000	1.26
  +++ Attribute.cpp	2 Nov 2004 13:53:31 -0000	1.27
  @@ -37,8 +37,7 @@
   #pragma warning (disable : 4786)
   #endif
   
  -#include <axis/server/Attribute.hpp>
  -#include <axis/server/GDefine.hpp>
  +#include "Attribute.h"
   #include "SoapSerializer.h"
   
   AXIS_CPP_NAMESPACE_START
  
  
  
  1.28      +1 -1      ws-axis/c/src/soap/ComplexElement.cpp
  
  Index: ComplexElement.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.cpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- ComplexElement.cpp	29 Oct 2004 15:34:57 -0000	1.27
  +++ ComplexElement.cpp	2 Nov 2004 13:53:31 -0000	1.28
  @@ -42,7 +42,7 @@
   /* ComplexElement.cpp: implementation of the ComplexElement class. */
   
   #include <axis/server/GDefine.hpp>
  -#include <axis/server/Attribute.hpp>
  +#include "Attribute.h"
   #include "ComplexElement.h"
   #include "SoapSerializer.h"
   
  
  
  
  1.20      +1 -1      ws-axis/c/src/soap/ComplexElement.h
  
  Index: ComplexElement.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.h,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- ComplexElement.h	26 Oct 2004 10:40:55 -0000	1.19
  +++ ComplexElement.h	2 Nov 2004 13:53:31 -0000	1.20
  @@ -50,7 +50,7 @@
   
   #include <list>
   #include <axis/server/BasicNode.hpp>
  -#include <axis/server/Attribute.hpp>
  +#include "Attribute.h"
   
   AXIS_CPP_NAMESPACE_START
   
  
  
  
  1.35      +3 -4      ws-axis/c/src/soap/HeaderBlock.cpp
  
  Index: HeaderBlock.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- HeaderBlock.cpp	29 Oct 2004 15:34:58 -0000	1.34
  +++ HeaderBlock.cpp	2 Nov 2004 13:53:31 -0000	1.35
  @@ -58,7 +58,6 @@
   #include <axis/server/BasicNode.hpp>
   #include "ComplexElement.h"
   #include "CharacterElement.h"
  -#include <axis/server/Attribute.hpp>
   
   AXIS_CPP_NAMESPACE_START
   
  @@ -501,7 +500,7 @@
       return pBasicNode;
   }
   
  -Attribute* HeaderBlock::createAttribute(const AxisChar *localname,
  +IAttribute* HeaderBlock::createAttribute(const AxisChar *localname,
                                           const AxisChar *prefix,
                                           const AxisChar *value)
   {
  @@ -517,7 +516,7 @@
       return pAttribute;
   }
   
  -Attribute* HeaderBlock::createAttribute(const AxisChar *localname,
  +IAttribute* HeaderBlock::createAttribute(const AxisChar *localname,
                                           const AxisChar *prefix,
                                           const AxisChar *uri,
                                           const AxisChar *value)
  @@ -528,7 +527,7 @@
       return pAttribute;
   }
   
  -Attribute* HeaderBlock::createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
  +IAttribute* HeaderBlock::createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
                                              eStdAttrType, 
                                              SOAP_VERSION eSOAP_VERSION)
   {
  
  
  
  1.17      +4 -3      ws-axis/c/src/soap/HeaderBlock.h
  
  Index: HeaderBlock.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HeaderBlock.h	26 Oct 2004 10:40:55 -0000	1.16
  +++ HeaderBlock.h	2 Nov 2004 13:53:31 -0000	1.17
  @@ -25,6 +25,7 @@
   
   using namespace std;
   class BasicNode;
  +class Attribute;
   
   /*
    *  @class BasicNode
  @@ -223,7 +224,7 @@
        *
        * @return A pointer to the created standard Attribute will be returned.
        */
  -    Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
  +    IAttribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
           SOAP_VERSION eSOAP_VERSION);
   
       /**
  @@ -239,7 +240,7 @@
         * @return A pointer to the created Attribute will be returned. If the
         *  operation is unsuccessfull it will return NULL.
         */
  -    Attribute* createAttribute(const AxisChar* localname, 
  +    IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
   
       /**
  @@ -251,7 +252,7 @@
         *
         * @return A pointer to the created Attribute will be returned.
         */
  -    Attribute* createAttribute(const AxisChar* localname, 
  +    IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, const AxisChar* value);
   
   		
  
  
  
  1.28      +1 -1      ws-axis/c/src/soap/SoapBody.cpp
  
  Index: SoapBody.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapBody.cpp,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- SoapBody.cpp	26 Oct 2004 10:40:55 -0000	1.27
  +++ SoapBody.cpp	2 Nov 2004 13:53:31 -0000	1.28
  @@ -39,7 +39,7 @@
   #include "SoapBody.h"
   #include "SoapSerializer.h"
   #include <axis/server/GDefine.hpp>
  -#include <axis/server/Attribute.hpp>
  +#include "Attribute.h"
   #include "../common/AxisTrace.h"
   
   extern AXIS_CPP_NAMESPACE_PREFIX AxisTrace* g_pAT;
  
  
  
  1.95      +0 -1      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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- SoapDeSerializer.cpp	29 Oct 2004 15:34:58 -0000	1.94
  +++ SoapDeSerializer.cpp	2 Nov 2004 13:53:31 -0000	1.95
  @@ -59,7 +59,6 @@
   #include "../engine/XMLParserFactory.h"
   #include "../xml/XMLParser.h"
   #include "../xml/QName.h"
  -#include <axis/server/Attribute.hpp>
   #include "AxisSoapException.h"
   #include <axis/AxisGenException.hpp>
   
  
  
  
  1.25      +1 -2      ws-axis/c/src/soap/SoapEnvelope.cpp
  
  Index: SoapEnvelope.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapEnvelope.cpp,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SoapEnvelope.cpp	26 Oct 2004 10:40:56 -0000	1.24
  +++ SoapEnvelope.cpp	2 Nov 2004 13:53:31 -0000	1.25
  @@ -25,10 +25,9 @@
   #include "SoapEnvelope.h"
   #include <axis/server/GDefine.hpp>
   #include "SoapSerializer.h"
  -#include <axis/server/Attribute.hpp>
  -
   #include <stdio.h>
   #include "../common/AxisTrace.h"
  +#include "Attribute.h"
   
   extern AXIS_CPP_NAMESPACE_PREFIX AxisTrace* g_pAT;
   
  
  
  
  1.27      +1 -1      ws-axis/c/src/soap/SoapHeader.cpp
  
  Index: SoapHeader.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapHeader.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- SoapHeader.cpp	26 Oct 2004 10:40:56 -0000	1.26
  +++ SoapHeader.cpp	2 Nov 2004 13:53:31 -0000	1.27
  @@ -33,7 +33,7 @@
   #include "SoapHeader.h"
   #include "SoapSerializer.h"
   #include <axis/server/GDefine.hpp>
  -#include <axis/server/Attribute.hpp>
  +#include "Attribute.h"
   #include "HeaderBlock.h"
   
   AXIS_CPP_NAMESPACE_START
  
  
  
  1.12      +1 -0      ws-axis/c/src/soap/SoapHeader.h
  
  Index: SoapHeader.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapHeader.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SoapHeader.h	26 Oct 2004 10:40:56 -0000	1.11
  +++ SoapHeader.h	2 Nov 2004 13:53:31 -0000	1.12
  @@ -56,6 +56,7 @@
   } HEADER_LEVELS;
   
   AXIS_CPP_NAMESPACE_START
  +class Attribute;
   
   class SoapHeader : public ISoapHeader
   {
  
  
  
  1.12      +0 -1      ws-axis/c/src/soap/SoapKeywordMapping.cpp
  
  Index: SoapKeywordMapping.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapKeywordMapping.cpp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SoapKeywordMapping.cpp	26 Oct 2004 10:40:56 -0000	1.11
  +++ SoapKeywordMapping.cpp	2 Nov 2004 13:53:31 -0000	1.12
  @@ -20,7 +20,6 @@
    */
   
   #include "SoapKeywordMapping.h"
  -#include <axis/server/Attribute.hpp>
   #include "../common/AxisUtils.h"
   
   AXIS_CPP_NAMESPACE_START
  
  
  
  1.12      +1 -0      ws-axis/c/src/soap/SoapKeywordMapping.h
  
  Index: SoapKeywordMapping.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapKeywordMapping.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SoapKeywordMapping.h	26 Oct 2004 10:40:56 -0000	1.11
  +++ SoapKeywordMapping.h	2 Nov 2004 13:53:31 -0000	1.12
  @@ -19,6 +19,7 @@
   
   #include "../common/AxisUtils.h"
   #include <axis/server/SoapEnvVersions.hpp>
  +#include "Attribute.h"
   #include <map>
   
   using namespace std;
  
  
  
  1.27      +1 -1      ws-axis/c/src/soap/SoapMethod.cpp
  
  Index: SoapMethod.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapMethod.cpp,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- SoapMethod.cpp	26 Oct 2004 10:40:56 -0000	1.26
  +++ SoapMethod.cpp	2 Nov 2004 13:53:31 -0000	1.27
  @@ -21,7 +21,7 @@
   
   
   #include "SoapMethod.h"
  -#include <axis/server/Attribute.hpp>
  +#include "Attribute.h"
   #include <axis/server/GDefine.hpp>
   
   AXIS_CPP_NAMESPACE_START
  
  
  
  1.29      +1 -0      ws-axis/c/src/soap/SoapSerializer.h
  
  Index: SoapSerializer.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/SoapSerializer.h,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- SoapSerializer.h	26 Oct 2004 10:40:56 -0000	1.28
  +++ SoapSerializer.h	2 Nov 2004 13:53:31 -0000	1.29
  @@ -32,6 +32,7 @@
   class SoapFault;
   class HeaderBlock;
   class IArrayBean;
  +class Attribute;
   
   /**
    *  @class SoapSerializer
  
  
  
  1.9       +72 -86    ws-axis/c/src/soap/Attribute.h
  
  
  
  
  1.5       +113 -126  ws-axis/c/tools/trace/org/apache/axis/tracetool/Tracer.java
  
  Index: Tracer.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/tools/trace/org/apache/axis/tracetool/Tracer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Tracer.java	12 Oct 2004 15:20:35 -0000	1.4
  +++ Tracer.java	2 Nov 2004 13:53:32 -0000	1.5
  @@ -28,28 +28,25 @@
   	private Signature signature = null;
   	private final static String SIGNATURE = "  /* AUTOINSERTED TRACE */";
   
  -      // Escape ?'s here to avoid trigraphs which map ??) to ]
  -	private final static String UNKNOWN_FORMAT = "\\?\\?\\?\\?";
  -
  -	private static Hashtable primitives = new Hashtable();
  +	private static Hashtable typetable = new Hashtable();
   	static {
  -		primitives.put("int", "%i");
  -		primitives.put("unsigned int", "%u");
  -		primitives.put("unsigned", "%u");
  -		primitives.put("short", "%hi");
  -		primitives.put("short int", "%hi");
  -		primitives.put("unsigned short int", "%hu");
  -		primitives.put("unsigned short", "%hu");
  -		primitives.put("long", "%li");
  -		primitives.put("long int", "%li");
  -		primitives.put("unsigned long int", "%lu");
  -		primitives.put("unsigned long", "%lu");
  -		primitives.put("double", "%f");
  -		primitives.put("float", "%f");
  -		primitives.put("char", "%c");
  -		primitives.put("unsigned char", "%c");
  -		primitives.put("bool", "%s");
  -		// TODO: More primitives go in here
  +		typetable.put("char", "CHAR");
  +		typetable.put("unsigned char", "CHAR");
  +		typetable.put("unsigned short", "USHORT");
  +		typetable.put("short", "SHORT");
  +		typetable.put("signed short", "SHORT");
  +		typetable.put("unsigned", "UINT");
  +		typetable.put("unsigned int", "UINT");
  +		typetable.put("int", "INT");
  +		typetable.put("signed int", "INT");
  +		typetable.put("signed", "INT");
  +		typetable.put("unsigned long", "ULONG");
  +		typetable.put("long", "LONG");
  +		typetable.put("signed long", "LONG");
  +		typetable.put("unsigned double", "UDOUBLE");
  +		typetable.put("double", "DOUBLE");
  +		typetable.put("float", "FLOAT");
  +		typetable.put("bool", "BOOL");
   	}
   
   	/**
  @@ -75,48 +72,34 @@
   	}
   
   	/**
  -	 * @param signature the signature of this method 
  +	 * @param signature the signature of this method
  +	 * TODO: Can't tell the difference between static and non-static 
  +	 * methods so can't tell whether to pass this or not. If we pass
  +	 * this in a static method it won't compile. 
   	 */
   	void traceEntry(Signature signature) throws IOException {
   		this.signature = signature;
   		if (!signature.traceable())
   			return;
   
  +		Parameter[] parms = signature.getParameters();
  +		int len = 0;
  +		if (null != parms)
  +			len = parms.length;
   		String line =
   			"\n"
  -				+ "    #ifdef ENABLE_AXISTRACE\n"
  -				+ "    if (g_pAT && g_pAT->isTraceOn()) try {\n"
  -				+ "        char traceLine[256];\n"
  -				+ "        sprintf(traceLine,\"> ";
  -		if (null != signature.getClassName())
  -			line += signature.getClassName();
  -		line += signature.getMethodName();
  -		line += "(";
  -
  -		Parameter[] parms = signature.getParameters();
  -		for (int i = 0; null != parms && i < parms.length; i++) {
  -			String f = getFormat(parms[i]);
  -			if (0 != i)
  -				line += ",";
  -			if (null == f)
  -				line += UNKNOWN_FORMAT;
  -			else
  -				line += f;
  -		}
  -		line += ")\"";
  -
  -		for (int i = 0; null != parms && i < parms.length; i++) {
  -			if (null == getFormat(parms[i]))
  -				continue;
  -			line += "," + getName(parms[i]);
  -		}
  -
  -		line += ");\n";
  -		line += "        g_pAT->traceLine(traceLine);" + SIGNATURE + "\n";
  -		line += "    } catch (...) {\n";
  -            line += "        g_pAT->traceLine(\"Unknown exception caught during trace entry\");\n";
  -            line += "    }\n";
  -		line += "    #endif\n";
  +				+ "\t#ifdef ENABLE_AXISTRACE\n"
  +				+ "\t\tif (g_pAT && g_pAT->isTraceOn())\n"
  +				+ "\t\t\tg_pAT->traceEntry("
  +				+ getClassName()
  +				+ ", \""
  +				+ signature.getMethodName()
  +				+ "\", NULL, "
  +				+ len;
  +		for (int i = 0; null != parms && i < parms.length; i++)
  +			line += getTypeParms(parms[i]);
  +		line += ");\t" + SIGNATURE + "\n";
  +		line += "\t#endif\n";
   		write(line);
   		flush();
   	}
  @@ -125,24 +108,29 @@
   		if (!signature.traceable())
   			return;
   
  -        // Check this method really should return void
  +		// Check this method really should return void
   		if (null != signature.getReturnType().getType())
   			Utils.rude(
   				"Expecting to return void from a method that returns a value: "
   					+ signature.toString());
   
   		// Enclose the printf/return in {} in case if/then doesn't have {}
  -		write("{");
  -		write(
  -			"\n    #ifdef ENABLE_AXISTRACE\n"
  -				+ "    if (g_pAT && g_pAT->isTraceOn()) g_pAT->traceLine(\"<  "
  -				+ signature.getMethodName()
  -				+ "\");"
  -				+ SIGNATURE
  -				+ "\n    #endif\n");
  +		String line = "\t{\n";
  +		line += "\t\t#ifdef ENABLE_AXISTRACE\n";
  +		line += "\t\t\tif (g_pAT && g_pAT->isTraceOn())\n";
  +		line += "\t\t\t\tg_pAT->traceExit("
  +			+ getClassName()
  +			+ ", \""
  +			+ signature.getMethodName()
  +			+ "\");\t"
  +			+ SIGNATURE
  +			+ "\n";
  +		line += "\t\t#endif\n";
   
   		// now print out the return line itself
  -		write("    return;\n    }\n");
  +		line += "\t\treturn;\n";
  +		line += "\t}\n";
  +		write(line);
   		flush();
   	}
   
  @@ -155,61 +143,42 @@
   		if (!signature.traceable())
   			return;
   
  -        // Check this method doesn't return void
  +		// Check this method doesn't return void
   		if (null == signature.getReturnType().getType())
   			Utils.rude(
   				"Expecting to return a value from a method that returns void: "
   					+ signature.toString());
   
  -        // Figure out the method name
  -		String methodName = "";
  -		if (null != signature.getClassName())
  -			methodName = signature.getClassName();
  -		methodName += signature.getMethodName();
  -		
  -		// We can't trace all kinds of C types unfortunately
  -		Parameter retType = signature.getReturnType();
  -		String format = getFormat(retType);
  -		String retValue;
  -		if (null == format) {
  -			format = UNKNOWN_FORMAT;
  -			retValue = "";
  -		} else
  -			retValue = ", " + getName(retType);
  -
   		// Enclose the printf/return in {} in case if/then doesn't have {}
   		// Copy the return value into a local called traceRet in case the
   		// return value has side-effects such as "return i++;" or "return func();"
   		// This makes sure that we don't execute the return value twice.
   		// Unfortunately if the return value is a class we will invoke 
   		// a copy constructor. When initialising traceRet with value, put value
  -            // in brackets in case it contains an operator that might be invoked
  -            // after the assignment, like another assignment.
  -		String line = "    {\n";
  -		line += "        #ifdef ENABLE_AXISTRACE\n";
  -		line += "            "
  -			+ retType.getType()
  +		// in brackets in case it contains an operator that might be invoked
  +		// after the assignment, like another assignment.
  +		String line = "\t{\n";
  +		line += "\t\t#ifdef ENABLE_AXISTRACE\n";
  +		line += "\t\t\t"
  +			+ signature.getReturnType().getType()
   			+ " traceRet = ("
   			+ value
   			+ ");\n";
  -		line += "            if (g_pAT && g_pAT->isTraceOn()) try {\n";
  -		line += "                char traceLine[256];\n";
  -		line += "                sprintf(traceLine,\"< "
  -			+ methodName
  -			+ "("
  -			+ format
  -			+ ")\""
  -			+ retValue
  -			+ ");\n";
  -		line += "                g_pAT->traceLine(traceLine);" + SIGNATURE + "\n";
  -		line += "            } catch (...) {\n";
  -            line += "                g_pAT->traceLine(\"Unknown exception caught during trace exit\");\n";
  -		line += "            }\n";
  -		line += "            return traceRet;\n";
  -		line += "        #else\n";
  -		line += "            return " + value + ";\n";
  -		line += "        #endif\n";
  -		line += "    }\n";
  +		line += "\t\t\tif (g_pAT && g_pAT->isTraceOn())\n";
  +		line += "\t\t\t\tg_pAT->traceExit("
  +			+ getClassName()
  +			+ ", \""
  +			+ signature.getMethodName()
  +			+ "\""
  +			+ getTypeParms(signature.getReturnType())
  +			+ ");\t"
  +			+ SIGNATURE
  +			+ "\n";
  +		line += "\t\t\treturn traceRet;\n";
  +		line += "\t\t#else\n";
  +		line += "\t\t\treturn " + value + ";\n";
  +		line += "\t\t#endif\n";
  +		line += "\t}\n";
   		write(line);
   		flush();
   	}
  @@ -220,30 +189,48 @@
   			System.out.print(s);
   	}
   
  -	private String getFormat(Parameter p) {
  -		String format = null;
  -		String type = p.getTypeWithoutConst();
  -		if (null == type || 0 == type.length())
  -			format = null;
  -		else if (type.endsWith("*"))
  -			// TODO print out contents of pointers where possible
  -			format = "%p";
  -		else if (primitives.keySet().contains(type))
  -			format = (String) primitives.get(type);
  -		// else System.err.println("Unknown format type "+type);
  -		// TODO: more elses should go in here
  -		return format;
  -	}
  -
  -	private String getName(Parameter p) {
  +	// TODO cope with STL strings
  +	// TODO cope with pointers to primitives
  +	// TODO cope with references
  +	private String getTypeParms(Parameter p) {
  +		String parms = ",\n\t\t\t\t\tAXIS_CPP_NAMESPACE_PREFIX TRACETYPE_";
   		String name = p.getName();
   		if (null == name)
   			name = "traceRet";
  +            name = "((void*)&"+name+")";
  +
  +		String type = p.getTypeWithoutConst();
  +		if (null == type || 0 == type.length())
  +			parms += "UNKNOWN, 0, NULL";
  +		else if (type.endsWith("*")) {
  +			String contents = type.substring(0, type.length() - 1);
  +			if ("char".equals(contents))
  +				parms += "STRING, 0, " + name;
  +			else if ("void".equals(contents))
  +				// We just don't know what this void* is pointing at 
  +				// so that best we can do is to print out the first byte.
  +				parms += "POINTER, 1, " + name;
  +			else
  +				parms += "POINTER, sizeof(" + contents + "), " + name;
  +		} else if (typetable.keySet().contains(type))
  +			parms += (String) typetable.get(type) + ", 0, " + name;
  +		else if (-1 != type.indexOf("&")) {
  +			// TODO: cope with references
  +			parms += "UNKNOWN, 0, " + name;
  +		} else
  +			parms += "DATA, sizeof(" + type + "), " + name;
  +
  +		return parms;
  +	}
   
  -		if ("bool".equals(p.getTypeWithoutConst())) {
  -			return "(" + name + "?\"true\":\"false\")";
  +	private String getClassName() {
  +		String name;
  +		if (null != signature.getClassName()) {
  +			name = signature.getClassName();
  +			name = name.substring(0, name.indexOf("::"));
  +			name = "\"" + name + "\"";
   		} else
  -			return name;
  +			name = "NULL";
  +		return name;
   	}
  -	
   }