• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ AXIS2_FREE函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: axis2_stub_on_complete_IIp2Location_get

        axis2_status_t AXIS2_CALL axis2_stub_on_complete_IIp2Location_get(axis2_callback_t *callback, const axutil_env_t *env)
        {
            axis2_status_t ( AXIS2_CALL *on_complete ) (const axutil_env_t *, adb_getResponse_t* _getResponse, void *data);
            struct axis2_stub_IIp2Location_get_callback_data* callback_data = NULL;
            void *user_data = NULL;
            axis2_status_t status = AXIS2_SUCCESS;
            adb_getResponse_t* ret_val;
            

            axiom_node_t *ret_node = NULL;
            axiom_soap_envelope_t *soap_envelope = NULL;

            

            callback_data = (struct axis2_stub_IIp2Location_get_callback_data*)axis2_callback_get_data(callback);

            
            soap_envelope = axis2_callback_get_envelope(callback, env);
            if(soap_envelope)
            {
                axiom_soap_body_t *soap_body;
                soap_body = axiom_soap_envelope_get_body(soap_envelope, env);
                if(soap_body)
                {
                    axiom_soap_fault_t *soap_fault = NULL;
                    axiom_node_t *body_node = axiom_soap_body_get_base_node(soap_body, env);

                      if(body_node)
                    {
                        ret_node = axiom_node_get_first_child(body_node, env);
                    }
                }
                
                
            }

            user_data = callback_data->data;
            on_complete = callback_data->on_complete;

            
                    if(ret_node != NULL)
                    {
                        ret_val = adb_getResponse_create(env);
     
                        if(adb_getResponse_deserialize(ret_val, env, &ret_node, NULL, AXIS2_FALSE ) == AXIS2_FAILURE)
                        {
                            AXIS2_LOG_ERROR( env->log, AXIS2_LOG_SI, "NULL returnted from the LendResponse_deserialize: "
                                                                    "This should be due to an invalid XML");
                            adb_getResponse_free(ret_val, env);
                            ret_val = NULL;
                        }
                     }
                     else
                     {
                         ret_val = NULL; 
                     }

                     
                         status = on_complete(env, ret_val, user_data);
                         
 
            if(callback_data)
            {
                AXIS2_FREE(env->allocator, callback_data);
            }
            return status;
        }
开发者ID:tempo-rary,项目名称:ip2LocationSample,代码行数:67,代码来源:axis2_stub_IIp2Location.c


示例17: add_subscriber

int add_subscriber()
{
    remote_registry_t *remote_registry = NULL;
    const axutil_env_t *env = NULL;
    axis2_char_t *subscription_id = NULL;
    axis2_char_t *id = NULL;
    axis2_char_t *path = NULL; 
    axis2_char_t *index_path = NULL; 
    remote_registry_resource_t *res = NULL;
    axutil_hash_t *properties = NULL;
	
    char *content = (char *) strdup("<subscription><syn:endpoint xmlns:syn=\"http://ws.apache.org/ns/synapse\"><syn:address uri=\"http://localhost:9000/services/SimpleStockQuoteService\" /></syn:endpoint></subscription>");

    axis2_char_t *epr_type = "application/vnd.epr";
    axis2_char_t *filter = "/weather/4/";
    axis2_char_t *reg_url = "http://localhost:9762/registry";

    env = axutil_env_create_all("test.log", AXIS2_LOG_LEVEL_TRACE);
    subscription_id = axutil_strcat(env, "urn:uuid:", axutil_uuid_gen(env), NULL);
    path = axutil_strcat(env, filter, SUBSCRIPTION_COLLECTION_NAME, "/", subscription_id, NULL);
    id = axutil_strcat(env, reg_url, filter, SUBSCRIPTION_COLLECTION_NAME, "/", subscription_id, NULL);
    remote_registry = remote_registry_create(env, reg_url, "admin", "admin");

    topic_index_init();
    res = remote_registry_resource_create(env);
    remote_registry_resource_set_content(res, env, content);
    remote_registry_resource_set_content_len(res, env, axutil_strlen(content));
    remote_registry_resource_set_media_type(res, env, epr_type);
    remote_registry_resource_set_description(res, env, "");

    properties = axutil_hash_make(env);
    if(properties)
    {
        axutil_hash_set(properties, axutil_strdup(env, "expires"), AXIS2_HASH_KEY_STRING, axutil_strdup(env, "*"));
        axutil_hash_set(properties, axutil_strdup(env, "staticFlag"), AXIS2_HASH_KEY_STRING, axutil_strdup(env, "false"));
        axutil_hash_set(properties, axutil_strdup(env, "filterValue"), AXIS2_HASH_KEY_STRING, axutil_strdup(env, filter));
        axutil_hash_set(properties, axutil_strdup(env, "subManagerURI"), AXIS2_HASH_KEY_STRING, axutil_strdup(env, "http://10.100.1.44:8280/services/SampleEventSource"));
        axutil_hash_set(properties, axutil_strdup(env, "filterDialect"), AXIS2_HASH_KEY_STRING, axutil_strdup(env, "http://synapse.apache.org/eventing/dialect/topicFilter"));
        remote_registry_resource_set_properties(res, env, properties);
    }

    remote_registry_put(remote_registry, env, path, res);
    if(id)
    {
        AXIS2_FREE(env->allocator, id);
    }
    if(path)
    {
        AXIS2_FREE(env->allocator, path);
        path = NULL;
    }
    if(res)
    {
        remote_registry_resource_free(res, env);
        res = NULL;
    }

    res = remote_registry_get(remote_registry, env, TOPIC_INDEX, NULL);
    if(!res)
    {
        return 0;
    }
    id = axutil_strcat(env, reg_url, TOPIC_INDEX, NULL);
    properties = remote_registry_resource_get_properties(res, env);
    if(properties)
    {
        path = axutil_strcat(env, filter, SUBSCRIPTION_COLLECTION_NAME, NULL);
        axutil_hash_set(properties, subscription_id, AXIS2_HASH_KEY_STRING, path);
        remote_registry_resource_set_properties(res, env, properties);
    }

    remote_registry_resource_set_content(res, env, NULL);
    remote_registry_resource_set_content_len(res, env, 0);
    index_path = axutil_strcat(env, TOPIC_INDEX, "/TopicIndex", NULL);
    remote_registry_put(remote_registry, env, TOPIC_INDEX, res);

    if(id)
    {
        AXIS2_FREE(env->allocator, id);
    }
    if(res)
    {
        remote_registry_resource_free(res, env);
        res = NULL;
    }
    printf("\n");

    return 0;
}
开发者ID:MI-LA01,项目名称:kt_wso2-php5.3,代码行数:89,代码来源:test_registry.c


示例18: axutil_url_create

AXIS2_EXTERN axutil_url_t *AXIS2_CALL
axutil_url_create(
    const axutil_env_t *env,
    const axis2_char_t *protocol,
    const axis2_char_t *host,
    const int port,
    const axis2_char_t *path)
{
    axutil_url_t *url = NULL;
    AXIS2_ENV_CHECK(env, NULL);
    AXIS2_PARAM_CHECK(env->error, protocol, NULL);

    if(!protocol || !*protocol || strstr(protocol, "://") || (host && strchr(host, '/')))
    {
        return NULL;
    }

    url = (axutil_url_t *)AXIS2_MALLOC(env->allocator, sizeof(axutil_url_t));

    if(!url)
    {
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Out of memory");
        return NULL;
    }
    url->protocol = axutil_strdup(env, protocol);
    url->host = NULL;
    url->path = NULL;
    url->server = NULL;
    url->query = NULL;

    if(host)
    {
        url->host = (axis2_char_t *)axutil_strdup(env, host);
        url->port = port;
    }
    else
    {
        url->port = 0;
    }

    /** if the path is not starting with / we have to make it so
     */
    if(path)
    {
        axis2_char_t *params = NULL;
        axis2_char_t *temp = NULL;
        if(path[0] == '/')
        {
            temp = (axis2_char_t *)axutil_strdup(env, path);
        }
        else
        {
            temp = axutil_stracat(env, "/", path);
        }
        params = strchr(temp, '?');
        if(!params)
        {
            params = strchr(temp, '#');
        }
        if(params)
        {
            url->query = (axis2_char_t *)axutil_strdup(env, params);
            *params = '\0';
        }
        url->path = (axis2_char_t *)axutil_strdup(env, temp);
        AXIS2_FREE(env->allocator, temp);
    }

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


示例19: prf_logOnResponseType_serialize_obj

        axiom_node_t* AXIS2_CALL
        prf_logOnResponseType_serialize_obj(
                prf_logOnResponseType_t* _logOnResponseType,
                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[PRF_DEFAULT_DIGIT_LIMIT];
                    
               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, _logOnResponseType, 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=\"logOnResponseType\"", NULL);
              axutil_stream_write(stream, env, type_attrib, axutil_strlen(type_attrib));

              AXIS2_FREE(env->allocator, type_attrib);
                
              string_to_stream = ">"; 
         

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ AXIS2_LOG_ERROR函数代码示例发布时间:2022-05-30
下一篇:
C++ AWAIT_EXPECT_RESPONSE_STATUS_EQ函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap