axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hawk...@apache.org
Subject cvs commit: ws-axis/c/include/axis IHeaderBlock.hpp
Date Tue, 22 Feb 2005 12:02:31 GMT
hawkeye     2005/02/22 04:02:30

  Modified:    c/src/soap HeaderBlock.cpp HeaderBlock.h
               c/include/axis IHeaderBlock.hpp
  Log:
  setURI and setPrefix now check for NULL and set the value to "". Also improved doc in IHeaderBlock.h
and
  removed duplicate doc from HeaderBlock.h
  
  Revision  Changes    Path
  1.49      +17 -3     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.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- HeaderBlock.cpp	18 Feb 2005 06:54:02 -0000	1.48
  +++ HeaderBlock.cpp	22 Feb 2005 12:02:30 -0000	1.49
  @@ -59,7 +59,7 @@
   #include "ComplexElement.h"
   #include "CharacterElement.h"
   #include "Namespace.h"
  -
  +#include <iostream>
   AXIS_CPP_NAMESPACE_START
   
   extern SoapEnvVersionsStruct gs_SoapEnvVersionsStruct[VERSION_LAST];
  @@ -173,13 +173,27 @@
    */
   int HeaderBlock::setPrefix(const AxisChar* prefix)
   {
  -    m_sPrefix= prefix;
  +	if(prefix)
  +	{
  +	    m_sPrefix= prefix;
  +	}
  +	else
  +	{
  +		m_sPrefix="";
  +	}
       return AXIS_SUCCESS;
   }
   
   int HeaderBlock::setURI(const AxisChar* uri)
   {
  -    m_uri= uri;
  +	if(uri)
  +	{
  +	    m_uri= uri;
  +	}
  +	else
  +	{
  +		m_uri="";
  +	}
       return AXIS_SUCCESS;
   }
   
  
  
  
  1.27      +2 -231    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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- HeaderBlock.h	11 Feb 2005 18:45:33 -0000	1.26
  +++ HeaderBlock.h	22 Feb 2005 12:02:30 -0000	1.27
  @@ -54,6 +54,7 @@
    *    - mustUnderstand attribute information item     
    *    - relay attribute information item 
    *    
  + *  @see IHeaderBlock
    *  @author Roshan Weerasuriya (roshan@opensource.lk, roshanw@jkcsworld.com)
    *  @author Samisa Abeysinghe (sabeysinghe@virtusa.com)
    *
  @@ -96,56 +97,11 @@
   
   public:	
   
  -    /** 
  -      * Creates a Attribute and adds it to this Header Block as a namespace. 
  -      * 
  -      * @param prefix The prefix of the attribute. 
  -      * @param uri The namespace uri of the attribute. 
  -      * 
  -      * @return A pointer to the created Attribute will be returned. or NULL if unsuccessful
  -      */
       INamespace* createNamespaceDecl(const AxisChar *prefix, 
               const AxisChar *uri); 
  -
  -	/**
  -	 * return the first child of this headerblock or NULL if there isn't one.
  -	 */
       BasicNode* getFirstChild();
  -
  -    /**
  -     * Returns the number of child elements of this HeaderBlock.
  -     *
  -     * @return The number of child elements of this HeaderBlock.
  -     */
       int getNoOfChildren();
   
  -    /**
  -      * Creates a child node depending on the given node type. i.e:
  -      * if node type == CHARACTER_NODE then it creates a Character Element.
  -      * if node type == ELEMENT_NODE then it creates a Complex Element.
  -      * This method doesn't add the created child to this Header Block. If the
  -      * user needs to add this created child then he has to use the
  -      * addChild(BasicNode *pBasicNode) method after creating the child.
  -      * If the node to be created is a CHARACTER_NODE then only the parameter
  -      * pachValue will be usefull and for others you can provide NULL.
  -      * If the node to be created is a ELEMENT_NODE then the parameters 
  -      * pachLocalName, pachPrefix, pachUri will be needed to provide and you
  -      * can provide NULL for the pachValue.
  -      *
  -      * @param eNODE_TYPE The node type to be created, i.e CHARACTER_NODE or
  -      * ELEMENT_NODE.
  -      * @param pachLocalName The local name of the child node. A CHARACTER_NODE
  -      * will ignore this.
  -      * @param pachPrefix The prefix of the child node. A CHARACTER_NODE
  -      * will ignore this.
  -      * @param pachUri The namespace uri of the child node. A CHARACTER_NODE
  -      * will ignore this.
  -      * @param pachValue The value of the child node. A ELEMENT_NODE
  -      * will ignore this.
  -      * 
  -      * @return The child node created will be returned if the creation is
  -      * successfull. If the creation is unsccessfull it will return NULL.
  -      */
       BasicNode* createChild(NODE_TYPE eNODE_TYPE,  
           AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
           AxisChar* pachValue);
  @@ -153,217 +109,32 @@
   #ifdef UNIT_TESTING_ON
       int initializeForTesting();
   #endif
  -  /**
  -   * Creates a child node depending on the given type. If the type is 
  -   *  CHARACTER_NODE a CharacterElement is created. If the type is 
  -   *  ELEMENT_NODE a ComplexElement is created. After creating the child it
  -   *  will be added as a immediate child to the header block.
  -   *  It is important to note that if the type is CHARACTER_NODE only the
  -   *  NODE_TYPE and value (pachValue) parameters will be usefull.If the type
  -   *  is ELEMENT_NODE the parameters NODE_TYPE, pachLocalName, pachPrefix, 
  -   *  pachUri will be usefull.
  -   * The caller of this method has to check the return value and if it is NULL
  -   *  then the operation is not successfull.
  -   *
  -   * @param eNODE_TYPE The type of the child to be created, it should be either 
  -   *  CHARACTER_NODE for CharacterElements or ELEMENT_NODE for 
  -   *  ComplexElements.
  -   * @param pachLocalName The local name of the complex element to be created.
  -   * @param pachPrefix The prefix of the complex element to be created.
  -   * @param pachUri The namespace uri of the complex element to be created.
  -   * @param pachValue The value of the character element to be created.
  -   *
  -   * @return The child node created will be returned if the creation is
  -   *  successfull. If the creation is unsccessfull it will return NULL.
  -   */
       BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, 
           AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
           AxisChar* pachValue);
   
  -    /**
  -      * Adds a Attribute to this Header Block.
  -      *
  -      * @param attr The Attribute to be added.
  -      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
  -      */
       int addAttribute(Attribute* attr);
  -
  -    /**
  -     * A user can use this method to create a standard HeaderBlock attribute. 
  -     * The types of HEADER_BLOCK_STD_ATTR_TYPE are:
  -     * ROLE_NEXT : To create the role attribute to point to next.
  -     * ROLE_NONE : To create the role attribute to point to none.
  -     * ROLE_ULTIMATE_RECEIVER : To create the role attribute to point to 
  -     * ultimate receiver.
  -     * ACTOR : To create the actor attribute to point to next.
  -     * MUST_UNDERSTAND_TRUE : To create the mustUnderstand attribute to 
  -     * point to true.
  -     * MUST_UNDERSTAND_FALSE : To create the mustUnderstand attribute to 
  -     * point to false.
  -     * To use ROLE_NEXT, 
  -     * ROLE_NONE, ROLE_ULTIMATE_RECEIVER, MUST_UNDERSTAND_TRUE,
  -     * MUST_UNDERSTAND_FALSE the user has to pass SOAP_VER_1_2 as the 
  -     * SOAP_VERSION.
  -     * To use ACTOR, MUST_UNDERSTAND_TRUE, MUST_UNDERSTAND_FALSE the user has 
  -     * to pass SOAP_VER_1_1 as the SOAP_VERSION.
  -     *
  -     * @param eStdAttrType The standard attribute to be created.
  -     * The current values that can be passes are: ROLE_NEXT, ROLE_NONE, 
  -     * ROLE_ULTIMATE_RECEIVER, ACTOR, MUST_UNDERSTAND_TRUE,
  -     * MUST_UNDERSTAND_FALSE.
  -     * @param eSOAP_VERSION The related soap version. 
  -     * The vallues which could be
  -     * passes are SOAP_VER_1_1 and SOAP_VER_1_2.
  -     *
  -     * @return A pointer to the created standard Attribute will be returned. or NULL if
unsuccessful
  -     */
       IAttribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE eStdAttrType, 
           SOAP_VERSION eSOAP_VERSION);
   
  -    /**
  -      * Creates a Attribute and adds it to this Header Block. This method will return 
  -      *  null to indicate unsuccessfull operation. The caller of this method 
  -      *  should check for the return NULL value.
  -      *
  -      * @param localname The local name of the attribute.
  -      * @param prefix The prefix of the attribute.
  -      * @param uri The namespace uri of the attribute.
  -      * @param value The value of the attribute.
  -      *
  -      * @return A pointer to the created Attribute will be returned. If the
  -      *  operation is unsuccessfull it will return NULL.
  -      */
       IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, const AxisChar* uri, const AxisChar* value);
   
  -    /**
  -      * Creates a Attribute and adds it to this Header Block.
  -      *
  -      * @param localname The local name of the attribute.
  -      * @param prefix The prefix of the attribute.
  -      * @param value The value of the attribute.
  -      *
  -      * @return A pointer to the created Attribute will be returned. or NULL if not successful
  -      */
       IAttribute* createAttribute(const AxisChar* localname, 
           const AxisChar* prefix, const AxisChar* value);
   
  -		
  -	/**
  -      * Gets an Attribute from the HeaderBlock.
  -      *
  -      * @param localname The local name of the attribute.
  -      * @param prefix The prefix of the attribute.
  -      *
  -      * @return the value of the attribute or NULL if not successful
  -      */
  -     virtual const AxisChar* getAttributeValue(const AxisChar* localname,
  +    virtual const AxisChar* getAttributeValue(const AxisChar* localname,
            const AxisChar* prefix);
  - 
  -
  -    /**
  -     * Creates a child node depending on the given type. If the type is 
  -     * CHARACTER_NODE a CharacterElement is created. If the type is 
  -     * ELEMENT_NODE a ComplexElement is created. After creating the child it
  -     * will be added as a immediate child to the header block.
  -     *
  -     * @param The type of the child to be created, it should be either 
  -     * CHARACTER_NODE for CharacterElements or ELEMENT_NODE for 
  -     * ComplexElements.
  -     * @return The child node created will be returned if the creation is
  -     * successfull. If the creation is unsccessfull it will return NULL.
  -     */
       BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE);
  -
  -    /**
  -     * Creates a child node depending on the given type. If the type is 
  -     * CHARACTER_NODE a CharacterElement is created. If the type is 
  -     * ELEMENT_NODE a ComplexElement is created. After creating the child it
  -     * will not be added as a child to the header block. The user has to add
  -     * the created child to the appropriate locaion as his wish.
  -     *
  -     * @param eNODE_TYPE The type of the child to be created, 
  -     * it should be either 
  -     * CHARACTER_NODE for CharacterElements or ELEMENT_NODE for 
  -     * ComplexElements.
  -     * @return The child node created will be returned if the creation is
  -     * successfull. If the creation is unsccessfull it will return NULL.
  -     */
       BasicNode* createChild(NODE_TYPE eNODE_TYPE);
  -
  -    /**
  -     * Returns the last child element. The user has to check whether the
  -     * method return NULL before proceding.
  -     *
  -     * @return The last child element is returned if it exists. 
  -     * If the child element doesn't exsist this method returns NULL.
  -     */
       BasicNode* getLastChild();
  -
  -    /**
  -     * Returns the child element at the given postion. 
  -     * The user has to check whether the
  -     * method return NULL before proceding.
  -     *
  -     * @param iChildPosition The positon of the required child element.
  -     * @return The required child element is returned if it exists. 
  -     * If the child element doesn't exsist this method returns NULL.
  -     */
       BasicNode* getChild(int iChildPosition);
  -
  -    /**
  -      * Adds a child node to the Header Block.
  -      *
  -      * @param pBasicNode The child node pointer which is to be added.
  -      * @return AXIS_SUCCESS to indicate successfull operation, AXIS_FAIL Otherwise
  -      */
       int addChild(BasicNode* pBasicNode);
  -
  -    /**
  -      * Sets the local name of this Header Block.
  -      *
  -      * @param localname The localname to set in.
  -      * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
  -      */
       int setLocalName(const AxisChar* localname);
  -    
       const AxisChar * getLocalName();
  -    /**
  -      * Sets the namespace uri of this Header Block.
  -      *
  -      * @param uri The namespace uri to set in.
  -      * @return AXIS_SUCCESS if succcesful, AXIS_FAIL otherwise
  -      */
       int setURI(const AxisChar* uri);
  -
  -	/* 
  -	 * Commented by Susantha - 21/06/2004
  -	 * The prefix should be decided by the Serializer at runtime
  -	 *
  -	 * Uncommented by Mark Whitlock - 24/8/04 after discussion 
  -	 * on the mailing list agreed to add back in this method.
  -	 * Jira issue AXISCPP-135
  -	 */
  -    /**
  -      * Sets the prefix of this Header Block.
  -      *
  -      * @param prefix The prefix to set in.
  -      * @return AXIS_SUCCESS if successful,  AXIS_FAIL otherwuse,
  -      */
       int setPrefix(const AxisChar* prefix);
   
  -    /**
  -      * Sets the namespace declaration of the Header Block.
  -      *
  -      * @param pAttribute The Attribute pointer which points to a valid 
  -      * namespace declartion Attribute.
  -      * @return AXIS_SUCCESS to indicate successfull operation. AXIS_FAIL to
  -      *  to indicate unsuccessfull operation.
  -      */
  -	/* TO DO: We need to remove this completely
  -	*
  -	int addNamespaceDecl(INamespace *pAttribute);
  -	*/
   
   	/**
         * The Constructor.
  
  
  
  1.10      +15 -15    ws-axis/c/include/axis/IHeaderBlock.hpp
  
  Index: IHeaderBlock.hpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/IHeaderBlock.hpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- IHeaderBlock.hpp	16 Feb 2005 11:47:46 -0000	1.9
  +++ IHeaderBlock.hpp	22 Feb 2005 12:02:30 -0000	1.10
  @@ -47,25 +47,25 @@
   {
   public:
       /** 
  -      * Sets the namespace declaration of the Header Block. 
  -      * 
  -      * @param pAttribute The Attribute pointer which points to a valid 
  -      * namespace declartion Attribute. 
  -      * @return AXIS_SUCCESS to indicate successfull operation. 
  -      */ 
  +    * Sets the namespace declaration of the Header Block. 
  +    *
  +    * @param pAttribute The Attribute pointer which points to a valid 
  +    * namespace declartion Attribute. 
  +    * @return AXIS_SUCCESS to indicate successfull operation. 
  +    */ 
   	/* TO DO: We need to remove this completely
   	*
   	virtual int addNamespaceDecl(INamespace *pAttribute)=0;
   	*/
   
       /** 
  -      * Creates a Attribute and adds it to this Header Block as a namespace. 
  -      * 
  -      * @param prefix The prefix of the attribute. 
  -      * @param uri The namespace uri of the attribute. 
  -      * 
  -      * @return A pointer to the created Attribute will be returned. 
  -      */ 
  +    * Creates a Attribute and adds it to this Header Block as a namespace. 
  +    * 
  +    * @param prefix The prefix of the attribute. 
  +    * @param uri The namespace uri of the attribute. 
  +    * 
  +    * @return A pointer to the created Attribute will be returned. 
  +    */ 
       virtual INamespace* createNamespaceDecl(const AxisChar *prefix, 
               const AxisChar *uri)=0; 
   
  @@ -277,7 +277,7 @@
       /**
         * Sets the namespace uri of this Header Block.
         *
  -      * @param uri The namespace uri to set in.
  +      * @param uri The namespace uri to set in. IF NULL is passed in then URI is set to
""
         * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         * 
         */
  @@ -295,7 +295,7 @@
       /**
         * Sets the prefix of this Header Block.
         *
  -      * @param prefix The prefix to set in.
  +      * @param prefix The prefix to set in.IF NULL is passed in the prefix is set to ""
         * @return AXIS_SUCCESS if successful AXIS_FAIL otherwise
         */
       virtual int setPrefix(const AxisChar* prefix)=0;
  
  
  

Mime
View raw message