[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-c-user
Subject:    Re: possible bug in WSDL2C-generated code
From:       "Senaka Fernando" <senaka () wso2 ! com>
Date:       2008-03-12 18:17:30
Message-ID: 47955.124.43.219.34.1205345130.squirrel () webmail4 ! pair ! com
[Download RAW message or body]

Hi all,

Oh! sorry I didn't notice that. I simply was under the impression that the
allocated string size lead to a buffer overrun.

Dimuthu, thanks for noticing that.

Regards,
Senaka

> Hi,
>
> The problem is due to double freeing the end_input_str. I fixed it in the
> svn,
>
>                            axutil_stream_write(stream, env,
> start_input_str, start_input_str_len);
>                            AXIS2_FREE(env->allocator,end_input_str);
> //// This should be corrected to
> AXIS2_FREE(env->allocator,start_input_str);
>
>
>                            text_value_2_temp =
> axutil_xml_quote_string(env, text_value_2, AXIS2_TRUE);
>                            if (text_value_2_temp)
>                            {
>                                axutil_stream_write(stream, env,
> text_value_2_temp, axutil_strlen(text_value_2_temp));
>                                AXIS2_FREE(env->allocator,
> text_value_2_temp);
>                            }
>                            else
>                            {
>                                axutil_stream_write(stream, env,
> text_value_2, axutil_strlen(text_value_2));
>
>                            }
>
>                            axutil_stream_write(stream, env,
> end_input_str, end_input_str_len);
> ######                AXIS2_FREE(env->allocator,end_input_str);
>
>
>
> Thanks
> Dimuthu
>
>
> On Wed, Mar 12, 2008 at 10:27 PM, Senaka Fernando <senaka@wso2.com> wrote:
>> Hi Carl,
>>
>>  Try this,
>>
>>  Replace: end_input_str =
>>
>> (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>                                  (5 + ADB_DEFAULT_DIGIT_LIMIT +
>>  axutil_strlen("RequestParameters")));
>>
>>  With: end_input_str =
>>
>> (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>                                  (5 + ADB_DEFAULT_DIGIT_LIMIT * 2 +
>>  axutil_strlen("RequestParameters")));
>>
>>  Regards,
>>  Senaka
>>
>>
>>
>>  > Hi Dimuthu,
>>  >
>>  > You are correct, I was mistakenly using the jars in the Axis2 1.3
>> instead
>>  > of
>>  > the nightly snapshot zip.
>>  >
>>  > with the new code, I get a "debug assertion failed" error.
>>  > (        _ASSERTE(_CrtIsValidHeapPointer(pUserData));      from
>> DBGHEAP.C)
>>  >
>>  > Is there some change needed in construction of the request parameters
>> with
>>  > the new version of the ADB stubs?
>>  >
>>  >
>>  > Carl
>>  >
>>  >
>>  > The generated file is:
>>  > (###### is added to line causing the problem)
>>  >
>>  >
>>  >         /**
>>  >          * adb_BrokerInformationRequestType.c
>>  >          *
>>  >          * This file was auto-generated from WSDL
>>  >          * by the Apache Axis2/C version: SNAPSHOT  Built on : Mar
>> 10,
>>  > 2008
>>  > (08:35:52 GMT+00:00)
>>  >          */
>>  >
>>  >         #include "adb_BrokerInformationRequestType.h"
>>  >
>>  >                 /*
>>  >                  * This type was generated from the piece of schema
>> that
>>  > had
>>  >                  * name = BrokerInformationRequestType
>>  >                  * Namespace URI =
>>  > http://www.axa.ca/BrokerInformationService/1.0/types/BrokerInformationRequestTypes
>>  >                  * Namespace Prefix = ns2
>>  >                  */
>>  >
>>  >
>>  >
>>  >         struct adb_BrokerInformationRequestType
>>  >         {
>>  >             adb_ParametersType_t* property_RequestParameters;
>>  >
>>  >
>>  >                 axis2_bool_t is_valid_RequestParameters;
>>  >
>>  >
>>  >             axis2_char_t* property_PortfolioNumber;
>>  >
>>  >
>>  >                 axis2_bool_t is_valid_PortfolioNumber;
>>  >
>>  >
>>  >
>>  >         };
>>  >
>>  >
>>  >        /************************* Private Function prototypes
>>  > ********************************/
>>  >
>>  >
>>  >                 axis2_status_t AXIS2_CALL
>>  >                 adb_BrokerInformationRequestType_set_RequestParameters_nil(
>>  >                         adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                         const axutil_env_t *env);
>>  >
>>  >
>>  >                 axis2_status_t AXIS2_CALL
>>  >                 adb_BrokerInformationRequestType_set_PortfolioNumber_nil(
>>  >                         adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                         const axutil_env_t *env);
>>  >
>>  >
>>  >
>>  >        /************************* Function Implmentations
>>  > ********************************/
>>  >         adb_BrokerInformationRequestType_t* AXIS2_CALL
>>  >         adb_BrokerInformationRequestType_create(
>>  >             const axutil_env_t *env)
>>  >         {
>>  >             adb_BrokerInformationRequestType_t
>>  > *_BrokerInformationRequestType = NULL;
>>  >
>>  >             AXIS2_ENV_CHECK(env, NULL);
>>  >
>>  >             _BrokerInformationRequestType =
>>  > (adb_BrokerInformationRequestType_t *) AXIS2_MALLOC(env->
>>  >                 allocator,
>> sizeof(adb_BrokerInformationRequestType_t));
>>  >
>>  >             if(NULL == _BrokerInformationRequestType)
>>  >             {
>>  >                 AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY,
>>  > AXIS2_FAILURE);
>>  >                 return NULL;
>>  >             }
>>  >
>>  >             memset(_BrokerInformationRequestType, 0,
>>  > sizeof(adb_BrokerInformationRequestType_t));
>>  >
>>  >             _BrokerInformationRequestType->property_RequestParameters
>>  =
>>  > NULL;
>>  >                   _BrokerInformationRequestType->is_valid_RequestParameters
>>  > = AXIS2_FALSE;
>>  >             _BrokerInformationRequestType->property_PortfolioNumber
>> =
>>  > NULL;
>>  >                   _BrokerInformationRequestType->is_valid_PortfolioNumber
>>  > =
>>  > AXIS2_FALSE;
>>  >
>>  >
>>  >             return _BrokerInformationRequestType;
>>  >         }
>>  >
>>  >         axis2_status_t AXIS2_CALL
>>  >         adb_BrokerInformationRequestType_free (
>>  >                 adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                 const axutil_env_t *env)
>>  >         {
>>  >
>>  >
>>  >             AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >             AXIS2_PARAM_CHECK(env->error,
>> _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >
>>  > adb_BrokerInformationRequestType_reset_RequestParameters(_BrokerInformationRequestType,
>>  > env);
>>  >
>>  > adb_BrokerInformationRequestType_reset_PortfolioNumber(_BrokerInformationRequestType,
>>  > env);
>>  >
>>  >
>>  >             if(_BrokerInformationRequestType)
>>  >             {
>>  >                 AXIS2_FREE(env->allocator,
>> _BrokerInformationRequestType);
>>  >                 _BrokerInformationRequestType = NULL;
>>  >             }
>>  >             return AXIS2_SUCCESS;
>>  >         }
>>  >
>>  >
>>  >
>>  >
>>  >         axis2_status_t AXIS2_CALL
>>  >         adb_BrokerInformationRequestType_deserialize(
>>  >                 adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                 const axutil_env_t *env,
>>  >                 axiom_node_t **dp_parent,
>>  >                 axis2_bool_t *dp_is_early_node_valid,
>>  >                 axis2_bool_t dont_care_minoccurs)
>>  >         {
>>  >           axiom_node_t *parent = *dp_parent;
>>  >
>>  >           axis2_status_t status = AXIS2_SUCCESS;
>>  >
>>  >               void *element = NULL;
>>  >
>>  >              axis2_char_t* text_value = NULL;
>>  >              axutil_qname_t *qname = NULL;
>>  >
>>  >             axutil_qname_t *element_qname = NULL;
>>  >
>>  >                axiom_node_t *first_node = NULL;
>>  >                axis2_bool_t is_early_node_valid = AXIS2_TRUE;
>>  >                axiom_node_t *current_node = NULL;
>>  >                axiom_element_t *current_element = NULL;
>>  >
>>  >             AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >             AXIS2_PARAM_CHECK(env->error,
>> _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >
>>  >
>>  >               while(parent && axiom_node_get_node_type(parent, env)
>> !=
>>  > AXIOM_ELEMENT)
>>  >               {
>>  >                   parent = axiom_node_get_next_sibling(parent, env);
>>  >               }
>>  >               if (NULL == parent)
>>  >               {
>>  >                 /* This should be checked before everything */
>>  >                 AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>>  >                             "Failed in building adb object for
>>  > BrokerInformationRequestType : "
>>  >                             "NULL elemenet can not be passed to
>>  > deserialize");
>>  >                 return AXIS2_FAILURE;
>>  >               }
>>  >
>>  >
>>  >                       first_node = axiom_node_get_first_child(parent,
>>  > env);
>>  >
>>  >
>>  >
>>  >
>>  >                      /*
>>  >                       * building RequestParameters element
>>  >                       */
>>  >
>>  >
>>  >
>>  >                                    current_node = first_node;
>>  >                                    is_early_node_valid = AXIS2_FALSE;
>>  >
>>  >
>>  >                                     while(current_node &&
>>  > axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
>>  >                                     {
>>  >                                         current_node =
>>  > axiom_node_get_next_sibling(current_node, env);
>>  >                                     }
>>  >                                     if(current_node != NULL)
>>  >                                     {
>>  >                                         current_element =
>> (axiom_element_t
>>  > *)axiom_node_get_data_element(current_node, env);
>>  >                                         qname =
>>  > axiom_element_get_qname(current_element, env, current_node);
>>  >                                     }
>>  >
>>  >                                  element_qname =
>> axutil_qname_create(env,
>>  > "RequestParameters", NULL, NULL);
>>  >
>>  >
>>  >                            if (adb_ParametersType_is_particle() ||
>>  >                                 (current_node   && current_element &&
>>  > (axutil_qname_equals(element_qname, env, qname) ||
>>  > !axutil_strcmp("RequestParameters",
>>  > axiom_element_get_localname(current_element, env)))))
>>  >                            {
>>  >                               if( current_node   && current_element
>> &&
>>  > (axutil_qname_equals(element_qname, env, qname) ||
>>  > !axutil_strcmp("RequestParameters",
>>  > axiom_element_get_localname(current_element, env))))
>>  >                               {
>>  >                                 is_early_node_valid = AXIS2_TRUE;
>>  >                               }
>>  >
>>  >
>>  >                                       element =
>>  > (void*)adb_ParametersType_create(env);
>>  >
>>  >                                       status =
>>  > adb_ParametersType_deserialize((adb_ParametersType_t*)element,
>>  >
>>  > env, &current_node, &is_early_node_valid, AXIS2_FALSE);
>>  >                                       if(AXIS2_FAILURE == status)
>>  >                                       {
>>  >                                           AXIS2_LOG_ERROR(env->log,
>>  > AXIS2_LOG_SI, "failed in building adb object for element
>>  > RequestParameters");
>>  >                                       }
>>  >                                       else
>>  >                                       {
>>  >                                           status =
>>  > adb_BrokerInformationRequestType_set_RequestParameters(_BrokerInformationRequestType,
>>  > env,
>>  >
>>  > (adb_ParametersType_t*)element);
>>  >                                       }
>>  >
>>  >                                  if(AXIS2_FAILURE ==  status)
>>  >                                  {
>>  >                                      AXIS2_LOG_ERROR(env->log,
>>  > AXIS2_LOG_SI,
>>  > "failed in setting the value for RequestParameters ");
>>  >                                      if(element_qname)
>>  >                                      {
>>  >                                          axutil_qname_free(element_qname,
>>  > env);
>>  >                                      }
>>  >                                      return AXIS2_FAILURE;
>>  >                                  }
>>  >                               }
>>  >
>>  >                               else if(!dont_care_minoccurs)
>>  >                               {
>>  >                                   if(element_qname)
>>  >                                   {
>>  >                                       axutil_qname_free(element_qname,
>>  > env);
>>  >                                   }
>>  >                                   /* this is not a nillable element*/
>>  >                                   AXIS2_LOG_ERROR(env->log,
>> AXIS2_LOG_SI,
>>  > "non nillable or minOuccrs != 0 element RequestParameters missing");
>>  >                                   return AXIS2_FAILURE;
>>  >                               }
>>  >
>>  >                   if(element_qname)
>>  >                   {
>>  >                      axutil_qname_free(element_qname, env);
>>  >                      element_qname = NULL;
>>  >                   }
>>  >
>>  >
>>  >
>>  >                      /*
>>  >                       * building PortfolioNumber element
>>  >                       */
>>  >
>>  >
>>  >
>>  >                                     /*
>>  >                                      * because elements are ordered
>> this
>>  > works fine
>>  >                                      */
>>  >
>>  >
>>  >                                    if(current_node != NULL &&
>>  > is_early_node_valid)
>>  >                                    {
>>  >                                        current_node =
>>  > axiom_node_get_next_sibling(current_node, env);
>>  >
>>  >
>>  >                                         while(current_node &&
>>  > axiom_node_get_node_type(current_node, env) != AXIOM_ELEMENT)
>>  >                                         {
>>  >                                             current_node =
>>  > axiom_node_get_next_sibling(current_node, env);
>>  >                                         }
>>  >                                         if(current_node != NULL)
>>  >                                         {
>>  >                                             current_element =
>>  > (axiom_element_t *)axiom_node_get_data_element(current_node, env);
>>  >                                             qname =
>>  > axiom_element_get_qname(current_element, env, current_node);
>>  >                                         }
>>  >
>>  >                                    }
>>  >                                    is_early_node_valid = AXIS2_FALSE;
>>  >
>>  >                                  element_qname =
>> axutil_qname_create(env,
>>  > "PortfolioNumber", NULL, NULL);
>>  >
>>  >
>>  >                            if (
>>  >                                 (current_node   && current_element &&
>>  > (axutil_qname_equals(element_qname, env, qname) ||
>>  > !axutil_strcmp("PortfolioNumber",
>>  > axiom_element_get_localname(current_element, env)))))
>>  >                            {
>>  >                               if( current_node   && current_element
>> &&
>>  > (axutil_qname_equals(element_qname, env, qname) ||
>>  > !axutil_strcmp("PortfolioNumber",
>>  > axiom_element_get_localname(current_element, env))))
>>  >                               {
>>  >                                 is_early_node_valid = AXIS2_TRUE;
>>  >                               }
>>  >
>>  >
>>  >                                       text_value =
>>  > axiom_element_get_text(current_element, env, current_node);
>>  >                                       if(text_value != NULL)
>>  >                                       {
>>  >                                             status =
>>  > adb_BrokerInformationRequestType_set_PortfolioNumber(_BrokerInformationRequestType,
>>  > env,
>>  >                                                                text_value);
>>  >                                       }
>>  >
>>  >                                       else
>>  >                                       {
>>  >                                             /*
>>  >                                              * axis2_qname_t *qname =
>>  > NULL;
>>  >                                              * axiom_attribute_t
>>  > *the_attri
>>  > = NULL;
>>  >                                              *
>>  >                                              * qname =
>>  > axutil_qname_create(env, "nil",
>>  > "http://www.w3.org/2001/XMLSchema-instance",
>>  > "xsi");
>>  >                                              * the_attri =
>>  > axiom_element_get_attribute(current_element, env, qname);
>>  >                                              */
>>  >                                             /* currently thereis a
>> bug in
>>  > the axiom_element_get_attribute, so we have to go to this bad method
>> */
>>  >
>>  >                                             axiom_attribute_t
>> *the_attri =
>>  > NULL;
>>  >                                             axis2_char_t *attrib_text
>> =
>>  > NULL;
>>  >                                             axutil_hash_t
>> *attribute_hash
>>  > =
>>  > NULL;
>>  >
>>  >                                             attribute_hash =
>>  > axiom_element_get_all_attributes(current_element, env);
>>  >
>>  >                                             attrib_text = NULL;
>>  >                                             if(attribute_hash)
>>  >                                             {
>>  >                                                  axutil_hash_index_t
>> *hi;
>>  >                                                  void *val;
>>  >                                                  const void *key;
>>  >
>>  >                                                  for (hi =
>>  > axutil_hash_first(attribute_hash, env); hi; hi =
>> axutil_hash_next(env,
>>  > hi))
>>  >                                                  {
>>  >                                                      axutil_hash_this(hi,
>>  > &key, NULL, &val);
>>  >
>>  >
>>  > if(strstr((axis2_char_t*)key,
>>  > "nil|http://www.w3.org/2001/XMLSchema-instance"))
>>  >                                                      {
>>  >                                                          the_attri =
>>  > (axiom_attribute_t*)val;
>>  >                                                          break;
>>  >                                                      }
>>  >                                                  }
>>  >                                             }
>>  >
>>  >                                             if(the_attri)
>>  >                                             {
>>  >                                                 attrib_text =
>>  > axiom_attribute_get_value(the_attri, env);
>>  >                                             }
>>  >                                             else
>>  >                                             {
>>  >                                                 /* this is hoping
>> that
>>  > attribute is stored in "http://www.w3.org/2001/XMLSchema-instance",
>> this
>>  > happnes when name is in default namespace */
>>  >                                                 attrib_text =
>>  > axiom_element_get_attribute_value_by_name(current_element, env,
>> "nil");
>>  >                                             }
>>  >
>>  >                                             if(attrib_text && 0 ==
>>  > axutil_strcmp(attrib_text, "1"))
>>  >                                             {
>>  >                                                 AXIS2_LOG_ERROR(env->log,
>>  > AXIS2_LOG_SI, "NULL value is set to a non nillable element
>>  > PortfolioNumber");
>>  >                                                 status =
>> AXIS2_FAILURE;
>>  >                                             }
>>  >                                             else
>>  >                                             {
>>  >                                                 /* after all, we
>> found
>>  > this
>>  > is a empty string */
>>  >                                                 status =
>>  > adb_BrokerInformationRequestType_set_PortfolioNumber(_BrokerInformationRequestType,
>>  > env,
>>  >                                                                    "");
>>  >                                             }
>>  >                                       }
>>  >
>>  >                                  if(AXIS2_FAILURE ==  status)
>>  >                                  {
>>  >                                      AXIS2_LOG_ERROR(env->log,
>>  > AXIS2_LOG_SI,
>>  > "failed in setting the value for PortfolioNumber ");
>>  >                                      if(element_qname)
>>  >                                      {
>>  >                                          axutil_qname_free(element_qname,
>>  > env);
>>  >                                      }
>>  >                                      return AXIS2_FAILURE;
>>  >                                  }
>>  >                               }
>>  >
>>  >                               else if(!dont_care_minoccurs)
>>  >                               {
>>  >                                   if(element_qname)
>>  >                                   {
>>  >                                       axutil_qname_free(element_qname,
>>  > env);
>>  >                                   }
>>  >                                   /* this is not a nillable element*/
>>  >                                   AXIS2_LOG_ERROR(env->log,
>> AXIS2_LOG_SI,
>>  > "non nillable or minOuccrs != 0 element PortfolioNumber missing");
>>  >                                   return AXIS2_FAILURE;
>>  >                               }
>>  >
>>  >                   if(element_qname)
>>  >                   {
>>  >                      axutil_qname_free(element_qname, env);
>>  >                      element_qname = NULL;
>>  >                   }
>>  >
>>  >           return status;
>>  >        }
>>  >
>>  >           axis2_bool_t AXIS2_CALL
>>  >           adb_BrokerInformationRequestType_is_particle()
>>  >           {
>>  >
>>  >                  return AXIS2_FALSE;
>>  >
>>  >           }
>>  >
>>  >
>>  >           void AXIS2_CALL
>>  >           adb_BrokerInformationRequestType_declare_parent_namespaces(
>>  >                     adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                     const axutil_env_t *env, axiom_element_t
>>  > *parent_element,
>>  >                     axutil_hash_t *namespaces, int *next_ns_index)
>>  >           {
>>  >
>>  >                   /* Here this is an empty function, Nothing to
>> declare */
>>  >
>>  >           }
>>  >
>>  >
>>  >
>>  >         axiom_node_t* AXIS2_CALL
>>  >         adb_BrokerInformationRequestType_serialize(
>>  >                 adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                 const axutil_env_t *env, axiom_node_t *parent,
>>  > axiom_element_t *parent_element, int parent_tag_closed, axutil_hash_t
>>  > *namespaces, int *next_ns_index)
>>  >         {
>>  >
>>  >
>>  >              axis2_char_t *string_to_stream;
>>  >
>>  >
>>  >          axiom_node_t *current_node = NULL;
>>  >          int tag_closed = 0;
>>  >
>>  >
>>  >
>>  >                 axiom_namespace_t *ns1 = NULL;
>>  >
>>  >                 axis2_char_t *qname_uri = NULL;
>>  >                 axis2_char_t *qname_prefix = NULL;
>>  >                 axis2_char_t *p_prefix = NULL;
>>  >                 axis2_bool_t ns_already_defined;
>>  >
>>  >                     axis2_char_t text_value_1[64];
>>  >
>>  >                     axis2_char_t *text_value_2;
>>  >                     axis2_char_t *text_value_2_temp;
>>  >
>>  >                axis2_char_t *start_input_str = NULL;
>>  >                axis2_char_t *end_input_str = NULL;
>>  >                unsigned int start_input_str_len = 0;
>>  >                unsigned int end_input_str_len = 0;
>>  >
>>  >
>>  >                axiom_data_source_t *data_source = NULL;
>>  >                axutil_stream_t *stream = NULL;
>>  >
>>  >
>>  >
>>  >             AXIS2_ENV_CHECK(env, NULL);
>>  >             AXIS2_PARAM_CHECK(env->error,
>> _BrokerInformationRequestType,
>>  > NULL);
>>  >
>>  >
>>  >                     current_node = parent;
>>  >                     data_source = (axiom_data_source_t
>>  > *)axiom_node_get_data_element(current_node, env);
>>  >                     if (!data_source)
>>  >                         return NULL;
>>  >                     stream =
>> axiom_data_source_get_stream(data_source,
>>  > env);
>>  > /* assume parent is of type data source */
>>  >                     if (!stream)
>>  >                         return NULL;
>>  >
>>  >             if(!parent_tag_closed)
>>  >             {
>>  >
>>  >               string_to_stream = ">";
>>  >               axutil_stream_write(stream, env, string_to_stream,
>>  > axutil_strlen(string_to_stream));
>>  >               tag_closed = 1;
>>  >
>>  >             }
>>  >
>>  >                        p_prefix = NULL;
>>  >
>>  >
>>  >                    if
>>  > (!_BrokerInformationRequestType->is_valid_RequestParameters)
>>  >                    {
>>  >
>>  >
>>  >                             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>> "Nil
>>  > value found in non-nillable property RequestParameters");
>>  >                             return NULL;
>>  >
>>  >                    }
>>  >                    else
>>  >                    {
>>  >                      start_input_str =
>>  > (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>  >                                  (4 + axutil_strlen(p_prefix) +
>>  >                                   axutil_strlen("RequestParameters")
>> +
>>  >                                   ADB_DEFAULT_DIGIT_LIMIT* 2));
>>  >
>>  >                      end_input_str =
>>  > (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>  >                                  (5 + ADB_DEFAULT_DIGIT_LIMIT +
>>  > axutil_strlen("RequestParameters")));
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >                      /*
>>  >                       * parsing RequestParameters element
>>  >                       */
>>  >
>>  >
>>  >
>>  >                             sprintf(start_input_str,
>>  > "<%s%sRequestParameters",
>>  >                                  p_prefix?p_prefix:"",
>>  >                                  (p_prefix && axutil_strcmp(p_prefix,
>>  > ""))?":":"");
>>  >
>>  >                         start_input_str_len =
>>  > axutil_strlen(start_input_str);
>>  >                         sprintf(end_input_str,
>> "</%s%sRequestParameters>",
>>  >                                  p_prefix?p_prefix:"",
>>  >                                  (p_prefix && axutil_strcmp(p_prefix,
>>  > ""))?":":"");
>>  >                         end_input_str_len =
>> axutil_strlen(end_input_str);
>>  >
>>  >                             if(!adb_ParametersType_is_particle())
>>  >                             {
>>  >                                 axutil_stream_write(stream, env,
>>  > start_input_str, start_input_str_len);
>>  >                                 AXIS2_FREE(env->allocator,start_input_str);
>>  >                             }
>>  >
>>  >
>>  > adb_ParametersType_serialize(_BrokerInformationRequestType->property_RequestParameters,
>>  >
>>  >
>>  > env, current_node, parent_element,
>>  >
>>  > adb_ParametersType_is_particle() || AXIS2_FALSE, namespaces,
>>  > next_ns_index);
>>  >
>>  >                             if(!adb_ParametersType_is_particle())
>>  >                             {
>>  >                                 axutil_stream_write(stream, env,
>>  > end_input_str, end_input_str_len);
>>  >                                 AXIS2_FREE(env->allocator,end_input_str);
>>  >                             }
>>  >
>>  >                  }
>>  >
>>  >
>>  >                        p_prefix = NULL;
>>  >
>>  >
>>  >                    if
>>  > (!_BrokerInformationRequestType->is_valid_PortfolioNumber)
>>  >                    {
>>  >
>>  >
>>  >                             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>> "Nil
>>  > value found in non-nillable property PortfolioNumber");
>>  >                             return NULL;
>>  >
>>  >                    }
>>  >                    else
>>  >                    {
>>  >                      start_input_str =
>>  > (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>  >                                  (4 + axutil_strlen(p_prefix) +
>>  >                                   axutil_strlen("PortfolioNumber") +
>>  >                                   ADB_DEFAULT_DIGIT_LIMIT* 2));
>>  >
>>  >                      end_input_str =
>>  > (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t) *
>>  >                                  (5 + ADB_DEFAULT_DIGIT_LIMIT +
>>  > axutil_strlen("PortfolioNumber")));
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >                      /*
>>  >                       * parsing PortfolioNumber element
>>  >                       */
>>  >
>>  >
>>  >
>>  >                             sprintf(start_input_str,
>>  > "<%s%sPortfolioNumber>",
>>  >                                  p_prefix?p_prefix:"",
>>  >                                  (p_prefix && axutil_strcmp(p_prefix,
>>  > ""))?":":"");
>>  >
>>  >                         start_input_str_len =
>>  > axutil_strlen(start_input_str);
>>  >                         sprintf(end_input_str,
>> "</%s%sPortfolioNumber>",
>>  >                                  p_prefix?p_prefix:"",
>>  >                                  (p_prefix && axutil_strcmp(p_prefix,
>>  > ""))?":":"");
>>  >                         end_input_str_len =
>> axutil_strlen(end_input_str);
>>  >
>>  >                            text_value_2 =
>>  > _BrokerInformationRequestType->property_PortfolioNumber;
>>  >
>>  >                            axutil_stream_write(stream, env,
>>  > start_input_str,
>>  > start_input_str_len);
>>  >                            AXIS2_FREE(env->allocator,end_input_str);
>>  >
>>  >
>>  >                            text_value_2_temp =
>>  > axutil_xml_quote_string(env,
>>  > text_value_2, AXIS2_TRUE);
>>  >                            if (text_value_2_temp)
>>  >                            {
>>  >                                axutil_stream_write(stream, env,
>>  > text_value_2_temp, axutil_strlen(text_value_2_temp));
>>  >                                AXIS2_FREE(env->allocator,
>>  > text_value_2_temp);
>>  >                            }
>>  >                            else
>>  >                            {
>>  >                                axutil_stream_write(stream, env,
>>  > text_value_2, axutil_strlen(text_value_2));
>>  >                            }
>>  >
>>  >                            axutil_stream_write(stream, env,
>> end_input_str,
>>  > end_input_str_len);
>>  > ######                AXIS2_FREE(env->allocator,end_input_str);
>>  >
>>  >                  }
>>  >
>>  >
>>  >
>>  >             return parent;
>>  >         }
>>  >
>>  >
>>  >
>>  >
>>  >             /**
>>  >              * getter for RequestParameters.
>>  >              */
>>  >             adb_ParametersType_t* AXIS2_CALL
>>  >             adb_BrokerInformationRequestType_get_RequestParameters(
>>  >                     adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                     const axutil_env_t *env)
>>  >              {
>>  >
>>  >                     AXIS2_ENV_CHECK(env, NULL);
>>  >                     AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType, NULL);
>>  >
>>  >
>>  >                 return
>>  > _BrokerInformationRequestType->property_RequestParameters;
>>  >              }
>>  >
>>  >             /**
>>  >              * setter for RequestParameters
>>  >              */
>>  >             axis2_status_t AXIS2_CALL
>>  >             adb_BrokerInformationRequestType_set_RequestParameters(
>>  >                     adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                     const axutil_env_t *env,
>>  >                     adb_ParametersType_t*  arg_RequestParameters)
>>  >              {
>>  >
>>  >
>>  >                 AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >                 AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >                 if(_BrokerInformationRequestType->is_valid_RequestParameters
>>  > &&
>>  >                         arg_RequestParameters ==
>>  > _BrokerInformationRequestType->property_RequestParameters)
>>  >                 {
>>  >
>>  >                     return AXIS2_SUCCESS;
>>  >                 }
>>  >
>>  >
>>  >                   if(NULL == arg_RequestParameters)
>>  >                   {
>>  >                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>>  > "RequestParameters is being set to NULL, but it is not a nullable
>>  > element");
>>  >                       return AXIS2_FAILURE;
>>  >                   }
>>  >
>>  > adb_BrokerInformationRequestType_reset_RequestParameters(_BrokerInformationRequestType,
>>  > env);
>>  >
>>  >
>>  >                 if(NULL == arg_RequestParameters)
>>  >                 {
>>  >                     /* We are already done */
>>  >                     return AXIS2_SUCCESS;
>>  >                 }
>>  >                 _BrokerInformationRequestType->property_RequestParameters
>>  > =
>>  > arg_RequestParameters;
>>  >
>>  > _BrokerInformationRequestType->is_valid_RequestParameters =
>> AXIS2_TRUE;
>>  >
>>  >                 return AXIS2_SUCCESS;
>>  >              }
>>  >
>>  >
>>  >
>>  >            /**
>>  >             * resetter for RequestParameters
>>  >             */
>>  >            axis2_status_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_reset_RequestParameters(
>>  >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                int i = 0;
>>  >                int count = 0;
>>  >                void *element = NULL;
>>
>> >
>>  >                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >                AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >                 if(_BrokerInformationRequestType->property_RequestParameters
>>  > != NULL)
>>  >                 {
>>  >
>>  >
>>  >
>>  > adb_ParametersType_free(_BrokerInformationRequestType->property_RequestParameters,
>>  > env);
>>
>> >
>>  > _BrokerInformationRequestType->property_RequestParameters = NULL;
>>  >                 }
>>  >
>>  >
>>  >
>>  >                 _BrokerInformationRequestType->is_valid_RequestParameters
>>  > =
>>  > AXIS2_FALSE;
>>  >                return AXIS2_SUCCESS;
>>  >            }
>>  >
>>  >            /**
>>  >             * Check whether RequestParameters is nill
>>  >             */
>>
>> >            axis2_bool_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_is_RequestParameters_nil(
>>
>> >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                AXIS2_ENV_CHECK(env, AXIS2_TRUE);
>>
>> >                AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_TRUE);
>>  >
>>  >                return
>>  > !_BrokerInformationRequestType->is_valid_RequestParameters;
>>  >            }
>>  >
>>  >            /**
>>  >             * Set RequestParameters to nill (currently the same as
>> reset)
>>
>> >             */
>>  >            axis2_status_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_set_RequestParameters_nil(
>>  >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                return
>>
>> > adb_BrokerInformationRequestType_reset_RequestParameters(_BrokerInformationRequestType,
>>  > env);
>>  >            }
>>  >
>>  >
>>  >
>>  >             /**
>>  >              * getter for PortfolioNumber.
>>  >              */
>>  >             axis2_char_t* AXIS2_CALL
>>  >             adb_BrokerInformationRequestType_get_PortfolioNumber(
>>
>> >                     adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                     const axutil_env_t *env)
>>  >              {
>>  >
>>  >                     AXIS2_ENV_CHECK(env, NULL);
>>  >                     AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType, NULL);
>>  >
>>  >
>>  >                 return
>>  > _BrokerInformationRequestType->property_PortfolioNumber;
>>  >              }
>>  >
>>  >             /**
>>  >              * setter for PortfolioNumber
>>  >              */
>>
>> >             axis2_status_t AXIS2_CALL
>>  >             adb_BrokerInformationRequestType_set_PortfolioNumber(
>>  >                     adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                     const axutil_env_t *env,
>>  >                     const axis2_char_t*  arg_PortfolioNumber)
>>
>> >              {
>>  >
>>  >
>>  >                 AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >                 AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >                 if(_BrokerInformationRequestType->is_valid_PortfolioNumber
>>  > &&
>>  >                         arg_PortfolioNumber ==
>>  > _BrokerInformationRequestType->property_PortfolioNumber)
>>  >                 {
>>  >
>>  >                     return AXIS2_SUCCESS;
>>  >                 }
>>  >
>>  >
>>  >                   if(NULL == arg_PortfolioNumber)
>>
>> >                   {
>>  >                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>>  > "PortfolioNumber is being set to NULL, but it is not a nullable
>> element");
>>  >                       return AXIS2_FAILURE;
>>  >                   }
>>  >
>>  > adb_BrokerInformationRequestType_reset_PortfolioNumber(_BrokerInformationRequestType,
>>  > env);
>>  >
>>  >
>>  >                 if(NULL == arg_PortfolioNumber)
>>
>> >                 {
>>  >                     /* We are already done */
>>  >                     return AXIS2_SUCCESS;
>>  >                 }
>>  >                 _BrokerInformationRequestType->property_PortfolioNumber
>> =
>>  > (axis2_char_t *)axutil_strdup(env, arg_PortfolioNumber);
>>  >                         if(NULL ==
>>  > _BrokerInformationRequestType->property_PortfolioNumber)
>>  >                         {
>>  >                             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
>> "Error
>>  > allocating memeory for PortfolioNumber");
>>  >                             return AXIS2_FAILURE;
>>  >                         }
>>  >
>>  > _BrokerInformationRequestType->is_valid_PortfolioNumber = AXIS2_TRUE;
>>  >
>>  >                 return AXIS2_SUCCESS;
>>  >              }
>>  >
>>  >
>>  >
>>  >            /**
>>  >             * resetter for PortfolioNumber
>>
>> >             */
>>  >            axis2_status_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_reset_PortfolioNumber(
>>
>> >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                int i = 0;
>>  >                int count = 0;
>>  >                void *element = NULL;
>>
>> >
>>  >                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
>>  >                AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_FAILURE);
>>  >
>>  >
>>  >
>>  >
>>  >
>>  >                 if(_BrokerInformationRequestType->property_PortfolioNumber
>>  > != NULL)
>>  >                 {
>>  >
>>  >
>>  >                         AXIS2_FREE(env-> allocator,
>>  > _BrokerInformationRequestType->property_PortfolioNumber);
>>
>> >                      _BrokerInformationRequestType->property_PortfolioNumber
>>  > = NULL;
>>  >                 }
>>  >
>>  >
>>  >
>>  >                 _BrokerInformationRequestType->is_valid_PortfolioNumber
>> =
>>  > AXIS2_FALSE;
>>  >                return AXIS2_SUCCESS;
>>  >            }
>>  >
>>  >            /**
>>  >             * Check whether PortfolioNumber is nill
>>  >             */
>>
>> >            axis2_bool_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_is_PortfolioNumber_nil(
>>
>> >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                AXIS2_ENV_CHECK(env, AXIS2_TRUE);
>>
>> >                AXIS2_PARAM_CHECK(env->error,
>>  > _BrokerInformationRequestType,
>>  > AXIS2_TRUE);
>>  >
>>  >                return
>>  > !_BrokerInformationRequestType->is_valid_PortfolioNumber;
>>  >            }
>>  >
>>  >            /**
>>  >             * Set PortfolioNumber to nill (currently the same as
>> reset)
>>  >             */
>>
>> >            axis2_status_t AXIS2_CALL
>>  >            adb_BrokerInformationRequestType_set_PortfolioNumber_nil(
>>  >                    adb_BrokerInformationRequestType_t*
>>  > _BrokerInformationRequestType,
>>  >                    const axutil_env_t *env)
>>  >            {
>>  >                return
>>
>> > adb_BrokerInformationRequestType_reset_PortfolioNumber(_BrokerInformationRequestType,
>>  > env);
>>  >            }
>>  >
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
>>  For additional commands, e-mail: axis-c-user-help@ws.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic