当前位置: 首页>>代码示例>>C++>>正文


C++ AXIS2_FREE函数代码示例

本文整理汇总了C++中AXIS2_FREE函数的典型用法代码示例。如果您正苦于以下问题:C++ AXIS2_FREE函数的具体用法?C++ AXIS2_FREE怎么用?C++ AXIS2_FREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了AXIS2_FREE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: rp_read_bin_mime_image

//-----------------------------------------------------------------------------
// Reads a binary image from the file fp.
// The file should be composed of HTTP mime messages as received in the form of
// an HTTP response. fp is already positioned at the start of the image.
// The boundary is given by boundId.
//
char * rp_read_bin_mime_image(
    const axutil_env_t * env,
    FILE *fp,
    const char *boundId,
    int *len)
{
    char     *image_binary   = NULL;

    int      actual_filled   = 0;

    TmpStore             *ts = NULL;
    axutil_linked_list_t *ll = axutil_linked_list_create(env);

    *len = 0;

    Rp_cb_ctx fill_ctx;
    init_rp_cb_ctx(env, &fill_ctx);
    fill_ctx.fp    = fp;
    fill_ctx.bound = boundId;

    while (!fill_ctx.done)
    {
        ts = (TmpStore *)AXIS2_MALLOC(env->allocator, sizeof(TmpStore));
        actual_filled = rp_fill_buff_CB(ts->buf, SP_IMG_BUF_SIZE, &fill_ctx);
        if (0 == actual_filled)
        {
            AXIS2_FREE(env->allocator, ts);
            break;
        }
        ts->size = actual_filled;
        *len    += actual_filled;
        axutil_linked_list_add (ll, env, (void *)ts);
    }

    image_binary = compose_buffer(env, *len, ll);
    axutil_linked_list_free(ll, env);
    return image_binary;
}
开发者ID:EOxServer,项目名称:soap-proxy,代码行数:44,代码来源:sp_image.c

示例2: build_om_payload_for_echo_svc_interop

/* build SOAP request message content using OM (for java interop)*/
axiom_node_t *
build_om_payload_for_echo_svc_interop(
    const axutil_env_t *env)
{
    axiom_node_t *ping_request_om_node = NULL;
    axiom_element_t* ping_request_om_ele = NULL;
    axiom_node_t *ping_om_node = NULL;
    axiom_element_t* ping_om_ele = NULL;
    axiom_node_t* text_om_node = NULL;
    axiom_element_t * text_om_ele = NULL;
    axiom_namespace_t *ns1 = NULL;
    axiom_namespace_t *ns0 = NULL;
    axis2_char_t *om_str = NULL;

    ns0 = axiom_namespace_create(env, "http://InteropBaseAddress/interop", "ns0");
    ns1 = axiom_namespace_create(env, "http://xmlsoap.org/Ping", "ns1");
    ping_request_om_ele
        = axiom_element_create(env, NULL, "PingRequest", ns0, &ping_request_om_node);
    ping_om_ele = axiom_element_create(env, ping_request_om_node, "Ping", ns1, &ping_om_node);

    text_om_ele = axiom_element_create(env, ping_om_node, "scenario", ns1, &text_om_node);
    axiom_element_set_text(text_om_ele, env, "scenario", text_om_node);
    text_om_node = NULL;
    text_om_ele = axiom_element_create(env, ping_om_node, "origin", ns1, &text_om_node);
    axiom_element_set_text(text_om_ele, env, "origin", text_om_node);
    text_om_node = NULL;
    text_om_ele = axiom_element_create(env, ping_om_node, "text", ns1, &text_om_node);
    axiom_element_set_text(text_om_ele, env, "text", text_om_node);

    om_str = axiom_node_to_string(ping_request_om_node, env);
    if(om_str)
    {
        printf("\nSending OM : %s\n", om_str);
        AXIS2_FREE(env->allocator, om_str);
        om_str = NULL;
    }
    return ping_request_om_node;
}
开发者ID:joshkamau,项目名称:wso2-wsf-php54,代码行数:39,代码来源:echo.c

示例3: axutil_stream_write_basic

int AXIS2_CALL
axutil_stream_write_basic(
    axutil_stream_t *stream,
    const axutil_env_t *env,
    const void *buffer,
    size_t count)
{
    int new_len = 0;

    if(!buffer)
        return -1;

    new_len = (int)(stream->len + count);
    /* We are sure that the difference lies within the int range */
    if(new_len > stream->max_len)
    {
        axis2_char_t *tmp = (axis2_char_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t)
            * (new_len + AXIS2_STREAM_DEFAULT_BUF_SIZE));
        if(!tmp)
        {
            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
            return -1;
        }
        /*
         * pre allocation: extra AXIS2_STREAM_DEFAULT_BUF_SIZE more bytes 
         * allocated 
         */
        stream->max_len = new_len + AXIS2_STREAM_DEFAULT_BUF_SIZE;
        memcpy(tmp, stream->buffer, sizeof(axis2_char_t) * stream->len);
        AXIS2_FREE(env->allocator, stream->buffer_head);
        stream->buffer = tmp;
        stream->buffer_head = tmp;
    }
    memcpy(stream->buffer + (stream->len * sizeof(axis2_char_t)), buffer, count);
    stream->len += (int)count;
    /* We are sure that the difference lies within the int range */
    return (int)count;
}
开发者ID:jzoppi,项目名称:axis2c-trunk,代码行数:38,代码来源:stream.c

示例4: service_admin_counter_set_last_count

void AXIS2_CALL
service_admin_counter_set_last_count (
    const axutil_env_t *env,
    axis2_msg_ctx_t *msg_ctx,
    axis2_char_t *svc_name,
    axis2_char_t *op_name,
    int last_count)
{
    int *count = NULL;
    axis2_conf_ctx_t *conf_ctx = NULL;
    axutil_property_t *property = NULL;
    axutil_hash_t *last_counts = NULL;
   
    conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
    if(svc_name && op_name)
    {
        axis2_char_t *key = NULL;
        key = axutil_strcat(env, svc_name, "-", op_name, NULL);
        property = axis2_conf_ctx_get_property(conf_ctx, env, SERVICE_ADMIN_COUNTER_LAST_OPERATION_COUNT);
        /* set_last_count is always called after get_last_count. So checking for existence of property
         * is not necessary here 
         */
        last_counts = axutil_property_get_value(property, env);
        count = axutil_hash_get(last_counts, key, AXIS2_HASH_KEY_STRING);
        *count = last_count;
        AXIS2_FREE(env->allocator, key);
    }
    else if(svc_name)
    {
        property = axis2_conf_ctx_get_property(conf_ctx, env, SERVICE_ADMIN_COUNTER_LAST_SERVICE_COUNT); 
        /* set_last_count is always called after get_last_count. So checking for existence of property
         * is not necessary here 
         */
        last_counts = axutil_property_get_value(property, env);
        count = axutil_hash_get(last_counts, svc_name, AXIS2_HASH_KEY_STRING);
        *count = last_count;
    }
}
开发者ID:AdrianRys,项目名称:wsf,代码行数:38,代码来源:counter.c

示例5: build_om_programatically

/* build SOAP request message content using OM */
axiom_node_t *
build_om_programatically(
    const axutil_env_t * env)
{
    axiom_node_t *notify_om_node = NULL;
    axiom_element_t *notify_om_ele = NULL;
    axiom_namespace_t *ns1 = NULL;
    axis2_char_t *buffer = NULL;

    ns1 = axiom_namespace_create(env, "http://example.org/notify", "m");
    notify_om_ele =
        axiom_element_create(env, NULL, "notify", ns1, &notify_om_node);
    axiom_element_set_text(notify_om_ele, env, "notify5", notify_om_node);

    buffer = axiom_node_to_string(notify_om_node, env);
    if (buffer)
    {
        printf("\nSending OM node in XML : %s \n", buffer);
        AXIS2_FREE(env->allocator, buffer);
    }

    return notify_om_node;
}
开发者ID:joshkamau,项目名称:wso2-wsf-php54,代码行数:24,代码来源:notify_client.c

示例6: build_om_payload_for_echo_svc

/* build SOAP request message content using OM */
axiom_node_t *
build_om_payload_for_echo_svc(const axutil_env_t *env)
{
    axiom_node_t *echo_om_node = NULL;
    axiom_element_t* echo_om_ele = NULL;
    axiom_node_t* text_om_node = NULL;
    axiom_element_t * text_om_ele = NULL;
    axiom_namespace_t *ns1 = NULL;
    axis2_char_t *om_str = NULL;

    ns1 = axiom_namespace_create(env, "http://ws.apache.org/axis2/c/samples", "ns1");
    echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
    text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
    axiom_element_set_text(text_om_ele, env, "echo5", text_om_node);

    om_str = axiom_node_to_string(echo_om_node, env);
    if (om_str)
    {
        AXIS2_FREE(env->allocator, om_str);
        om_str =  NULL;
    }
    return echo_om_node;
}
开发者ID:AdrianRys,项目名称:wsf,代码行数:24,代码来源:subscriber.c

示例7: axutil_dll_desc_create_platform_specific_dll_name

AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axutil_dll_desc_create_platform_specific_dll_name(
    axutil_dll_desc_t *dll_desc,
    const axutil_env_t *env,
    const axis2_char_t *class_name)
{
    axis2_char_t *temp_name = NULL;

    AXIS2_ENV_CHECK(env, NULL);

    /* allow config to give a literal lib name since it may want a 
     * versioned lib like "libfoo.so.0" */
    if (axutil_strstr(class_name, AXIS2_LIB_SUFFIX)) {
            /* assume the class_name is the literal lib file name */
            dll_desc->dll_name = axutil_strdup(env,class_name);
            return dll_desc->dll_name;
    }

    temp_name = axutil_stracat(env, AXIS2_LIB_PREFIX, class_name);
    dll_desc->dll_name = axutil_stracat(env, temp_name, AXIS2_LIB_SUFFIX);
    AXIS2_FREE(env->allocator, temp_name);
    return dll_desc->dll_name;
}
开发者ID:alexis-gruet,项目名称:axis2c-trunk,代码行数:23,代码来源:dll_desc.c

示例8: axiom_output_set_xml_version

AXIS2_EXTERN axis2_status_t AXIS2_CALL
axiom_output_set_xml_version(
    axiom_output_t * om_output,
    const axutil_env_t * env,
    axis2_char_t * xml_version)
{
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);

    AXIS2_PARAM_CHECK(env->error, xml_version, AXIS2_FAILURE);

    if(om_output->xml_version)
    {
        AXIS2_FREE(env->allocator, om_output->xml_version);
        om_output->xml_version = NULL;
    }

    om_output->xml_version = axutil_strdup(env, xml_version);
    if(!om_output->xml_version)
    {
        return AXIS2_FAILURE;
    }
    return AXIS2_SUCCESS;
}
开发者ID:Denisss025,项目名称:wsfcpp,代码行数:23,代码来源:om_output.c

示例9: Axis2Service_free

  static int AXIS2_CALL Axis2Service_free(axis2_svc_skeleton_t *pSvcSkeleton, const axutil_env_t *pEnv)
  {
    staff::LogDebug() << "stopping StaffService";

#if !defined WIN32
    m_bShuttingDown = true;
    staff::ServiceDispatcher::Inst().Deinit();
#endif

#ifndef WITHOUT_SECURITY
    staff_security_free();
#endif

    if (pSvcSkeleton)
    {
      AXIS2_FREE(pEnv->allocator, pSvcSkeleton);
      pSvcSkeleton = NULL;
    }

    staff::CrashHandler::Disable();

    return AXIS2_SUCCESS; 
  }
开发者ID:AmesianX,项目名称:staff,代码行数:23,代码来源:StaffService.cpp

示例10: axis2_handler_desc_set_class_name

AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_handler_desc_set_class_name(
    axis2_handler_desc_t * handler_desc,
    const axutil_env_t * env,
    const axis2_char_t * class_name)
{
    if(handler_desc->class_name)
    {
        AXIS2_FREE(env->allocator, handler_desc->class_name);
    }

    if(class_name)
    {
        handler_desc->class_name = axutil_strdup(env, class_name);
        if(!handler_desc->class_name)
        {
            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "No memory");
            return AXIS2_FAILURE;
        }
    }

    return AXIS2_SUCCESS;
}
开发者ID:Denisss025,项目名称:wsfcpp,代码行数:24,代码来源:handler_desc.c

示例11: adb_getReservationStatusesResponse_free

        axis2_status_t AXIS2_CALL
        adb_getReservationStatusesResponse_free (
                adb_getReservationStatusesResponse_t* _getReservationStatusesResponse,
                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, _getReservationStatusesResponse, AXIS2_FAILURE);

            adb_getReservationStatusesResponse_reset_reservationStatuses(_getReservationStatusesResponse, env);
            

            if(_getReservationStatusesResponse)
            {
                AXIS2_FREE(env->allocator, _getReservationStatusesResponse);
                _getReservationStatusesResponse = NULL;
            }
            return AXIS2_SUCCESS;
        }
开发者ID:arun07,项目名称:minisip_salcas,代码行数:24,代码来源:adb_getReservationStatusesResponse.c

示例12: axiom_output_free

AXIS2_EXTERN void AXIS2_CALL
axiom_output_free(
    axiom_output_t * om_output,
    const axutil_env_t * env)
{
    AXIS2_ENV_CHECK_VOID(env);

    if(om_output->xml_version)
    {
        AXIS2_FREE(env->allocator, om_output->xml_version);
    }
    if(om_output->mime_boundary)
    {
        AXIS2_FREE(env->allocator, om_output->mime_boundary);
    }
    if(om_output->next_content_id)
    {
        AXIS2_FREE(env->allocator, om_output->next_content_id);
    }
    if(om_output->root_content_id)
    {
        AXIS2_FREE(env->allocator, om_output->root_content_id);
    }

    if(om_output->xml_writer)
    {
        axiom_xml_writer_free(om_output->xml_writer, env);
    }

    if(om_output->binary_node_list)
    {
        axutil_array_list_free(om_output->binary_node_list, env);
    }

    if(om_output->content_type)
    {
        AXIS2_FREE(env->allocator, om_output->content_type);
    }

    AXIS2_FREE(env->allocator, om_output);
    return;
}
开发者ID:Denisss025,项目名称:wsfcpp,代码行数:42,代码来源:om_output.c

示例13: adb_UAKType_serialize_obj

        axiom_node_t* AXIS2_CALL
        adb_UAKType_serialize_obj(
                adb_UAKType_t* _UAKType,
                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)
        {
            
            
               axiom_attribute_t *text_attri = NULL;
             
             axis2_char_t *string_to_stream;
            
         
         axiom_node_t* current_node = NULL;
         int tag_closed = 0;
         axis2_char_t* xsi_prefix = NULL;
         axiom_namespace_t* xsi_ns = NULL;
         axiom_attribute_t* xsi_type_attri = NULL;
         
         axis2_char_t* type_attrib = NULL;
         
            axiom_data_source_t *data_source = NULL;
            axutil_stream_t *stream = NULL;
            axis2_char_t *text_value;
             
               axiom_namespace_t *ns1 = NULL;
               axis2_char_t *p_prefix = 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)
            {
            
                if(_UAKType->is_valid_issuerID)
                {
                
                        p_prefix = NULL;
                      
                           text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * 
                                                            (5  + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT +
                                                             axutil_strlen(_UAKType->property_issuerID) + 
                                                                axutil_strlen("issuerID")));
                           sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"",
                                                "issuerID", _UAKType->property_issuerID);
                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
                           AXIS2_FREE(env-> allocator, text_value);
                        
                   }
                   
                   else
                   {
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute issuerID");
                      return NULL;
                   }
                   
                if(_UAKType->is_valid_collectionID)
                {
                
                        p_prefix = NULL;
                      
                           text_value = (axis2_char_t*) AXIS2_MALLOC (env-> allocator, sizeof (axis2_char_t) * 
                                                            (5  + ADB_DEFAULT_NAMESPACE_PREFIX_LIMIT +
                                                             axutil_strlen(_UAKType->property_collectionID) + 
                                                                axutil_strlen("collectionID")));
                           sprintf(text_value, " %s%s%s=\"%s\"", p_prefix?p_prefix:"", (p_prefix && axutil_strcmp(p_prefix, ""))?":":"",
                                                "collectionID", _UAKType->property_collectionID);
                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
                           AXIS2_FREE(env-> allocator, text_value);
                        
                   }
                   
                   else
                   {
                      AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Nil value found in non-optional attribute collectionID");
                      return NULL;
                   }
                   
              string_to_stream = ">"; 
              axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
              tag_closed = 1;
            
            }
        
               if(!parent_tag_closed && !tag_closed)
               {
                  text_value = ">"; 
                  axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
               }
               
               text_value = adb_UAKType_serialize_to_string(_UAKType, env, namespaces);
               if(text_value)
               {
                    axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
                    AXIS2_FREE(env->allocator, text_value);
               }
//.........这里部分代码省略.........
开发者ID:kolibre,项目名称:libkolibre-daisyonline,代码行数:101,代码来源:adb_UAKType.c

示例14: adb_UAKType_deserialize_obj

        axis2_status_t AXIS2_CALL
        adb_UAKType_deserialize_obj(
                adb_UAKType_t* _UAKType,
                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;
          
              axiom_attribute_t *parent_attri = NULL;
              axiom_element_t *parent_element = NULL;
              axis2_char_t *attrib_text = NULL;

              axutil_hash_t *attribute_hash = NULL;

          
              void *element = NULL;
           
             const axis2_char_t* text_value = NULL;
             axutil_qname_t *qname = NULL;
          
            
            status = AXIS2_FAILURE;
            if(parent)
            {
                axis2_char_t *attrib_text = NULL;
                attrib_text = axiom_element_get_attribute_value_by_name(axiom_node_get_data_element(parent, env), env, "nil");
                if (attrib_text != NULL && !axutil_strcasecmp(attrib_text, "true"))
                {
                  
                   /* but the wsdl says that, this is non nillable */
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "NULL value is set to a non nillable element UAKType");
                    status = AXIS2_FAILURE;
                   
                }
                else
                {
                    axiom_node_t *text_node = NULL;
                    axiom_text_t *text_element = NULL;
                    text_node = axiom_node_get_first_child(parent, env);
                    if (text_node &&
                            axiom_node_get_node_type(text_node, env) == AXIOM_TEXT)
                        text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, env);
                    text_value = "";
                    if(text_element && axiom_text_get_value(text_element, env))
                    {
                        text_value = (axis2_char_t*)axiom_text_get_value(text_element, env);
                    }
                    status = adb_UAKType_deserialize_from_string(_UAKType, env, text_value, parent);
                }
            }
            
                 parent_element = (axiom_element_t *)axiom_node_get_data_element(parent, env);
                 attribute_hash = axiom_element_get_all_attributes(parent_element, env);
              
                
                
                  parent_attri = NULL;
                  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(!strcmp((axis2_char_t*)key, "issuerID"))
                             
                               {
                                   parent_attri = (axiom_attribute_t*)val;
                                   AXIS2_FREE(env->allocator, hi);
                                   break;
                               }
                       }
                  }

                  if(parent_attri)
                  {
                    attrib_text = axiom_attribute_get_value(parent_attri, env);
                  }
                  else
                  {
                    /* this is hoping that attribute is stored in "issuerID", this happnes when name is in default namespace */
                    attrib_text = axiom_element_get_attribute_value_by_name(parent_element, env, "issuerID");
                  }

                  if(attrib_text != NULL)
                  {
                      
                      adb_UAKType_set_issuerID(_UAKType,
                                                          env, attrib_text);
                        
                    }
//.........这里部分代码省略.........
开发者ID:kolibre,项目名称:libkolibre-daisyonline,代码行数:101,代码来源:adb_UAKType.c

示例15: adb_TransformTypeChoice_serialize_obj

        axiom_node_t* AXIS2_CALL
        adb_TransformTypeChoice_serialize_obj(
                adb_TransformTypeChoice_t* _TransformTypeChoice,
                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;
         axis2_char_t* xsi_prefix = NULL;
         axiom_namespace_t* xsi_ns = NULL;
         axiom_attribute_t* xsi_type_attri = NULL;
         
         axis2_char_t* type_attrib = NULL;
         
                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;
                    axis2_char_t *text_value_1_temp;
                    
                    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, _TransformTypeChoice, 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)
            {
            
              
 
              if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING)))
              {
                  /* it is better to stick with the standard prefix */
                  xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi");
                  
                  axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix);

                  if(parent_element)
                  {
                        axiom_namespace_t *element_ns = NULL;
                        element_ns = axiom_namespace_create(env, "http://www.w3.org/2001/XMLSchema-instance",
                                                            xsi_prefix);
                        axiom_element_declare_namespace_assume_param_ownership(parent_element, env, element_ns);
                        if(element_ns)
                        {
                            axiom_namespace_free(element_ns, env);
                        }
                  }
              }
              type_attrib = axutil_strcat(env, " ", xsi_prefix, ":type=\"TransformTypeChoice\"", NULL);
              axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib));

              AXIS2_FREE(env->allocator, type_attrib);
                
              string_to_stream = ">"; 
              axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
              tag_closed = 1;
            
            }
            else {
              /* if the parent tag closed we would be able to declare the type directly on the parent element */ 
              if(!(xsi_prefix = (axis2_char_t*)axutil_hash_get(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING)))
              {
                  /* it is better to stick with the standard prefix */
                  xsi_prefix = (axis2_char_t*)axutil_strdup(env, "xsi");
                  
                  axutil_hash_set(namespaces, "http://www.w3.org/2001/XMLSchema-instance", AXIS2_HASH_KEY_STRING, xsi_prefix);

                  if(parent_element)
                  {
                        axiom_namespace_t *element_ns = NULL;
//.........这里部分代码省略.........
开发者ID:isidrogc,项目名称:libkolibre-daisyonline,代码行数:101,代码来源:adb_TransformTypeChoice.c


注:本文中的AXIS2_FREE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。