コード例 #1
0
ファイル: param.c プロジェクト: alexis-gruet/axis2c-trunk
void AXIS2_CALL
axutil_param_free(
    axutil_param_t *param,
    const axutil_env_t *env)
{
    void *param_value = NULL;
    axis2_char_t *param_name = NULL;

    param_value = axutil_param_get_value(param, env);
    if(param_value)
    {
        if(param && param->value_free)
        {
            param->value_free(param_value, env);
        }
        else /* we assume that param value is axis2_char_t* */
        {
            AXIS2_FREE(env->allocator, param_value);
        }
    }

    if(param->attrs)
    {
        axutil_hash_index_t *i = NULL;
        void *v = NULL;

        for(i = axutil_hash_first(param->attrs, env); i; i = axutil_hash_next(env, i))
        {
            axutil_hash_this(i, NULL, NULL, &v);
            axutil_generic_obj_free(v, env);
        }
        axutil_hash_free(param->attrs, env);
    }

    if(param->value_list)
    {
        int i = 0, size = 0;

        size = axutil_array_list_size(param->value_list, env);
        for(i = 0; i < size; i++)
        {
            axutil_param_t *param_l = NULL;

            param_l = (axutil_param_t *)axutil_array_list_get(param->value_list, env, i);
            if(param_l)
            {
                axutil_param_free(param_l, env);
            }
        }
        axutil_array_list_free(param->value_list, env);
    }
    param_name = axutil_param_get_name(param, env);
    AXIS2_FREE(env->allocator, param_name);
    AXIS2_FREE(env->allocator, param);
    return;
}
コード例 #2
0
static axis2_http_header_t *
axis2_libcurl_get_first_header(
    axis2_libcurl_t *curl,
    const axutil_env_t * env,
    const axis2_char_t * str)
{
    axis2_http_header_t *tmp_header = NULL;
    axis2_char_t *tmp_header_str = NULL;
    axis2_char_t *tmp_name = NULL;
    int i = 0;
    int count = 0;
    axutil_array_list_t *header_group = NULL;

    AXIS2_PARAM_CHECK(env->error, curl, NULL);
    AXIS2_PARAM_CHECK(env->error, str, NULL);

    header_group = curl->alist;
    if (!header_group)
    {
        return NULL;
    }

    if (0 == axutil_array_list_size(header_group, env))
    {
        return NULL;
    }

    count = axutil_array_list_size(header_group, env);

    for (i = 0; i < count; i++)
    {
        tmp_header_str = (axis2_char_t *) axutil_array_list_get(header_group,
            env, i);
        if(!tmp_header_str)
        {
            continue;
        }
        tmp_header = (axis2_http_header_t *) axis2_http_header_create_by_str(env, tmp_header_str);
        if(!tmp_header)
        {
            continue;
        }

        tmp_name = axis2_http_header_get_name(tmp_header, env);
        if (0 == axutil_strcasecmp(str, tmp_name))
        {
            return tmp_header;
        }
        else
        {
            axis2_http_header_free( tmp_header, env );
        }

    }
    return NULL;
}
コード例 #3
0
            /**
             * setter for return
             */
            axis2_status_t AXIS2_CALL
            adb_getSystemPermissionsOfExternalRoleResponse_set_return(
                    adb_getSystemPermissionsOfExternalRoleResponse_t* _getSystemPermissionsOfExternalRoleResponse,
                    const axutil_env_t *env,
                    axutil_array_list_t*  arg_return)
             {
                
                 int size = 0;
                 int i = 0;
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
                

                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
                AXIS2_PARAM_CHECK(env->error, _getSystemPermissionsOfExternalRoleResponse, AXIS2_FAILURE);
                
                if(_getSystemPermissionsOfExternalRoleResponse->is_valid_return &&
                        arg_return == _getSystemPermissionsOfExternalRoleResponse->property_return)
                {
                    
                    return AXIS2_SUCCESS; 
                }

                
                 size = axutil_array_list_size(arg_return, env);
                 
                 if (size < 0)
                 {
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "return has less than minOccurs(0)");
                     return AXIS2_FAILURE;
                 }
                 for(i = 0; i < size; i ++ )
                 {
                     if(NULL != axutil_array_list_get(arg_return, env, i))
                     {
                         non_nil_exists = AXIS2_TRUE;
                         break;
                     }
                 }

                 adb_getSystemPermissionsOfExternalRoleResponse_reset_return(_getSystemPermissionsOfExternalRoleResponse, env);

                
                if(NULL == arg_return)
                {
                    /* We are already done */
                    return AXIS2_SUCCESS;
                }
                _getSystemPermissionsOfExternalRoleResponse->property_return = arg_return;
                        if(non_nil_exists)
                        {
                            _getSystemPermissionsOfExternalRoleResponse->is_valid_return = AXIS2_TRUE;
                        }
                        
                    
                return AXIS2_SUCCESS;
             }
コード例 #4
0
AXIS2_EXTERN neethi_assertion_t *AXIS2_CALL
rp_wss10_builder_build(
    const axutil_env_t *env,
    axiom_node_t *node,
    axiom_element_t *element)
{
    rp_wss10_t *wss10 = NULL;
    neethi_policy_t *policy = NULL;
    axiom_node_t *child_node = NULL;
    axiom_element_t *child_element = NULL;
    axutil_array_list_t *alternatives = NULL;
    neethi_operator_t *component = NULL;
    neethi_all_t *all = NULL;
    neethi_assertion_t *assertion = NULL;
    neethi_policy_t *normalized_policy = NULL;

    wss10 = rp_wss10_create(env);

    child_node = axiom_node_get_first_element(node, env);
    if(!child_node)
    {
        return NULL;
    }

    if(axiom_node_get_node_type(child_node, env) == AXIOM_ELEMENT)
    {
        child_element = (axiom_element_t *)axiom_node_get_data_element(child_node, env);
        if(child_element)
        {
            policy = neethi_engine_get_policy(env, child_node, child_element);
            if(!policy)
            {
                return NULL;
            }
            normalized_policy = neethi_engine_get_normalize(env, AXIS2_FALSE, policy);
            neethi_policy_free(policy, env);
            policy = NULL;
            alternatives = neethi_policy_get_alternatives(normalized_policy, env);
            component = (neethi_operator_t *)axutil_array_list_get(alternatives, env, 0);
            all = (neethi_all_t *)neethi_operator_get_value(component, env);
            wss10_process_alternatives(env, all, wss10);

            assertion = neethi_assertion_create_with_args(env, (AXIS2_FREE_VOID_ARG)rp_wss10_free,
                wss10, ASSERTION_TYPE_WSS10);

            neethi_policy_free(normalized_policy, env);
            normalized_policy = NULL;

            return assertion;
        }
        else
            return NULL;
    }
    else
        return NULL;
}
            /**
             * setter for contentFormat
             */
            axis2_status_t AXIS2_CALL
            adb_supportedContentFormats_type0_set_contentFormat(
                    adb_supportedContentFormats_type0_t* _supportedContentFormats_type0,
                    const axutil_env_t *env,
                    axutil_array_list_t*  arg_contentFormat)
             {
                
                 int size = 0;
                 int i = 0;
                 axis2_bool_t non_nil_exists = AXIS2_FALSE;
                

                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
                AXIS2_PARAM_CHECK(env->error, _supportedContentFormats_type0, AXIS2_FAILURE);
                
                if(_supportedContentFormats_type0->is_valid_contentFormat &&
                        arg_contentFormat == _supportedContentFormats_type0->property_contentFormat)
                {
                    
                    return AXIS2_SUCCESS; 
                }

                
                 size = axutil_array_list_size(arg_contentFormat, env);
                 
                 if (size < 0)
                 {
                     AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "contentFormat has less than minOccurs(0)");
                     return AXIS2_FAILURE;
                 }
                 for(i = 0; i < size; i ++ )
                 {
                     if(NULL != axutil_array_list_get(arg_contentFormat, env, i))
                     {
                         non_nil_exists = AXIS2_TRUE;
                         break;
                     }
                 }

                 adb_supportedContentFormats_type0_reset_contentFormat(_supportedContentFormats_type0, env);

                
                if(NULL == arg_contentFormat)
                {
                    /* We are already done */
                    return AXIS2_SUCCESS;
                }
                _supportedContentFormats_type0->property_contentFormat = arg_contentFormat;
                        if(non_nil_exists)
                        {
                            _supportedContentFormats_type0->is_valid_contentFormat = AXIS2_TRUE;
                        }
                        
                    
                return AXIS2_SUCCESS;
             }
コード例 #6
0
ファイル: wsf_util.c プロジェクト: harunjuhasz/wsf
axis2_char_t *
wsf_util_get_http_headers_from_op_client (
    axis2_op_client_t * op_client,
    axutil_env_t * env,
    axis2_wsdl_msg_labels_t msg_label)
{
    if (op_client) {
        const axis2_msg_ctx_t *msg_ctx = NULL;
        axutil_property_t *client_property = NULL;
        axis2_http_client_t *client = NULL;
        axis2_http_simple_response_t *response = NULL;
        axutil_array_list_t *list = NULL;
        axis2_http_header_t *header = NULL;
        int i;
        char *header_buf = NULL;

        msg_ctx = axis2_op_client_get_msg_ctx (op_client, env, msg_label);
        if (!msg_ctx)
            return NULL;
        client_property =
            (axutil_property_t *) axis2_msg_ctx_get_property (msg_ctx, env,
                    AXIS2_HTTP_CLIENT);

        if (client_property)
            client =
                (axis2_http_client_t *)
                axutil_property_get_value (client_property, env);
        else
            return NULL;

        if (client && (msg_label == AXIS2_WSDL_MESSAGE_LABEL_OUT)) {
            response = axis2_http_client_get_response (client, env);
            if (response)
                list = axis2_http_simple_response_get_headers (response, env);
            else
                return NULL;
        }

        if (list) {
            header_buf = malloc (500);
            if (!axutil_array_list_is_empty (list, env)) {
                for (i = 0; i < axutil_array_list_size (list, env); i++) {
                    header =
                        (axis2_http_header_t *) axutil_array_list_get (list,
                                env, i);
                    strcat (header_buf,
                            axis2_http_header_to_external_form (header, env));
                }
                return header_buf;
            }
        }

    }
    return NULL;
}
 /**
  * Check whether return is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_getSystemPermissionsOfSpecialInternalRoleResponse_is_return_nil_at(
         adb_getSystemPermissionsOfSpecialInternalRoleResponse_t* _getSystemPermissionsOfSpecialInternalRoleResponse,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _getSystemPermissionsOfSpecialInternalRoleResponse, AXIS2_TRUE);
     
     return (_getSystemPermissionsOfSpecialInternalRoleResponse->is_valid_return == AXIS2_FALSE ||
              NULL == _getSystemPermissionsOfSpecialInternalRoleResponse->property_return || 
              NULL == axutil_array_list_get(_getSystemPermissionsOfSpecialInternalRoleResponse->property_return, env, i));
 }
コード例 #8
0
 /**
  * Check whether extraElement is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_CanonicalizationMethodType_is_extraElement_nil_at(
         adb_CanonicalizationMethodType_t* _CanonicalizationMethodType,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _CanonicalizationMethodType, AXIS2_TRUE);
     
     return (_CanonicalizationMethodType->is_valid_extraElement == AXIS2_FALSE ||
              NULL == _CanonicalizationMethodType->property_extraElement || 
              NULL == axutil_array_list_get(_CanonicalizationMethodType->property_extraElement, env, i));
 }
コード例 #9
0
/**
 * Check whether return is nill at i
 */
axis2_bool_t AXIS2_CALL
adb_listExternalUsersResponse_is_return_nil_at(
    adb_listExternalUsersResponse_t* _listExternalUsersResponse,
    const axutil_env_t *env, int i)
{
    AXIS2_ENV_CHECK(env, AXIS2_TRUE);
    AXIS2_PARAM_CHECK(env->error, _listExternalUsersResponse, AXIS2_TRUE);

    return (_listExternalUsersResponse->is_valid_return == AXIS2_FALSE ||
            NULL == _listExternalUsersResponse->property_return ||
            NULL == axutil_array_list_get(_listExternalUsersResponse->property_return, env, i));
}
 /**
  * Check whether contentFormat is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_supportedContentFormats_type0_is_contentFormat_nil_at(
         adb_supportedContentFormats_type0_t* _supportedContentFormats_type0,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _supportedContentFormats_type0, AXIS2_TRUE);
     
     return (_supportedContentFormats_type0->is_valid_contentFormat == AXIS2_FALSE ||
              NULL == _supportedContentFormats_type0->property_contentFormat || 
              NULL == axutil_array_list_get(_supportedContentFormats_type0->property_contentFormat, env, i));
 }
コード例 #11
0
ファイル: svc.c プロジェクト: Denisss025/wsfcpp
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_svc_disengage_module(
    axis2_svc_t * svc,
    const axutil_env_t * env,
    axis2_module_desc_t * module_desc,
    axis2_conf_t * conf)
{
    axis2_phase_resolver_t *phase_resolver = NULL;
    axis2_status_t status = AXIS2_FAILURE;
    const axis2_char_t *svcname = NULL;

    AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE);
    svcname = axis2_svc_get_name(svc, env);

    phase_resolver = axis2_phase_resolver_create_with_config(env, conf);
    if(!phase_resolver)
    {
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Creating phase resolver failed for service %s",
                        svcname);
        return AXIS2_FAILURE;
    }
    status = axis2_phase_resolver_disengage_module_from_svc(phase_resolver, env, svc, module_desc);
    if(status == AXIS2_SUCCESS)
    {
        /** Remove this module from the engaged modules list */
        const axutil_qname_t *mod_qname = NULL;
        int i = 0, size = 0;

        mod_qname = axis2_module_desc_get_qname(module_desc, env);

        size = axutil_array_list_size(svc->engaged_module_list, env);
        for(i = 0; i < size; i++)
        {
            const axutil_qname_t *module_qname_l = NULL;
            axis2_module_desc_t *module_desc_l = NULL;

            module_desc_l = (axis2_module_desc_t *)axutil_array_list_get(svc->engaged_module_list, env,
                            i);
            module_qname_l = axis2_module_desc_get_qname(module_desc_l, env);

            if(axutil_qname_equals(mod_qname, env, module_qname_l))
            {
                axutil_array_list_remove(svc->engaged_module_list, env, i);
                break;
            }
        }
    }

    axis2_phase_resolver_free(phase_resolver, env);

    return status;
}
コード例 #12
0
/**
 * Check whether publishedOperations is nill at i
 */
axis2_bool_t AXIS2_CALL
adb_OperationMetaDataWrapper_is_publishedOperations_nil_at(
    adb_OperationMetaDataWrapper_t* _OperationMetaDataWrapper,
    const axutil_env_t *env, int i)
{
    AXIS2_ENV_CHECK(env, AXIS2_TRUE);
    AXIS2_PARAM_CHECK(env->error, _OperationMetaDataWrapper, AXIS2_TRUE);

    return (_OperationMetaDataWrapper->is_valid_publishedOperations == AXIS2_FALSE ||
            NULL == _OperationMetaDataWrapper->property_publishedOperations ||
            NULL == axutil_array_list_get(_OperationMetaDataWrapper->property_publishedOperations, env, i));
}
コード例 #13
0
 /**
  * Check whether service is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_getServicesResponse_is_service_nil_at(
         adb_getServicesResponse_t* _getServicesResponse,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _getServicesResponse, AXIS2_TRUE);
     
     return (_getServicesResponse->is_valid_service == AXIS2_FALSE ||
              NULL == _getServicesResponse->property_service || 
              NULL == axutil_array_list_get(_getServicesResponse->property_service, env, i));
 }
コード例 #14
0
 /**
  * Check whether reservationStatuses is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_getReservationStatusesResponse_is_reservationStatuses_nil_at(
         adb_getReservationStatusesResponse_t* _getReservationStatusesResponse,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _getReservationStatusesResponse, AXIS2_TRUE);
     
     return (_getReservationStatusesResponse->is_valid_reservationStatuses == AXIS2_FALSE ||
              NULL == _getReservationStatusesResponse->property_reservationStatuses || 
              NULL == axutil_array_list_get(_getReservationStatusesResponse->property_reservationStatuses, env, i));
 }
コード例 #15
0
 /**
  * Check whether Transform is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_TransformsType_is_Transform_nil_at(
         adb_TransformsType_t* _TransformsType,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _TransformsType, AXIS2_TRUE);
     
     return (_TransformsType->is_valid_Transform == AXIS2_FALSE ||
              NULL == _TransformsType->property_Transform || 
              NULL == axutil_array_list_get(_TransformsType->property_Transform, env, i));
 }
 /**
  * Check whether protocol is nill at i
  */
 axis2_bool_t AXIS2_CALL
 adb_additionalTransferProtocols_type0_is_protocol_nil_at(
         adb_additionalTransferProtocols_type0_t* _additionalTransferProtocols_type0,
         const axutil_env_t *env, int i)
 {
     AXIS2_ENV_CHECK(env, AXIS2_TRUE);
     AXIS2_PARAM_CHECK(env->error, _additionalTransferProtocols_type0, AXIS2_TRUE);
     
     return (_additionalTransferProtocols_type0->is_valid_protocol == AXIS2_FALSE ||
              NULL == _additionalTransferProtocols_type0->property_protocol || 
              NULL == axutil_array_list_get(_additionalTransferProtocols_type0->property_protocol, env, i));
 }
コード例 #17
0
ファイル: main.c プロジェクト: Denisss025/wsfcpp
int
main(
    int argc,
    char **argv)
{
    axis2_status_t status = AXIS2_FAILURE;
    int i = 0;
    axutil_array_list_t *policy_list = NULL;
    axutil_array_list_t *policy_node_list = NULL;
    neethi_policy_t *resultant = NULL;
    axutil_allocator_t *allocator = axutil_allocator_init(NULL);
    axutil_error_t *error = axutil_error_create(allocator);
    const axutil_env_t *env = axutil_env_create_with_error(allocator, error);

    policy_list = axutil_array_list_create(env, 0);
    policy_node_list = axutil_array_list_create(env, 0);

    get_all_policy(argv[1], env, policy_node_list, argv[2]);

    for (i = 0; i < axutil_array_list_size(policy_node_list, env); i++)
    {
        axiom_node_t *node = NULL;
        node = (axiom_node_t *) axutil_array_list_get(policy_node_list, env, i);
        status = load_policy_array(policy_list, node, env);
    }

    resultant = merge_policylist(policy_list, env);
    if (!resultant)
    {
        printf("Error Merging\n");
        return 0;
    }
    else
    {
        axiom_node_t *s_node = NULL;
        axis2_char_t *buff = NULL;
        s_node = neethi_engine_serialize(resultant, env);
        if (!s_node)
        {
            printf("Serializing failed\n");
            return 0;
        }
        buff = axiom_node_to_string(s_node, env);
        printf("\n%s", buff);
    }
    printf("Successful\n");
    return 0;

}
コード例 #18
0
ファイル: engine.c プロジェクト: alexis-gruet/axis2c-trunk
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_engine_resume_invocation_phases(
    axis2_engine_t * engine,
    const axutil_env_t * env,
    axutil_array_list_t * phases,
    axis2_msg_ctx_t * msg_ctx)
{
    int i = 0;
    int count = 0;
    axis2_bool_t found_match = AXIS2_FALSE;

    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Start:axis2_engine_resume_invocation_phases");
    AXIS2_PARAM_CHECK(env->error, phases, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);

    axis2_msg_ctx_set_paused(msg_ctx, env, AXIS2_FALSE);

    count = axutil_array_list_size(phases, env);

    for(i = 0; i < count && !(axis2_msg_ctx_is_paused(msg_ctx, env)); i++)
    {
        axis2_phase_t *phase = (axis2_phase_t *)axutil_array_list_get(phases, env, i);
        const axis2_char_t *phase_name = axis2_phase_get_name(phase, env);
        const axis2_char_t *paused_phase_name = axis2_msg_ctx_get_paused_phase_name(msg_ctx, env);
        /* Skip invoking handlers until we find the paused phase */
        if(phase_name && paused_phase_name && 0 == axutil_strcmp(phase_name, paused_phase_name))
        {
            int paused_handler_i = -1;
            found_match = AXIS2_TRUE;

            paused_handler_i = axis2_msg_ctx_get_current_handler_index(msg_ctx, env);
            /* Invoke the paused handler and rest of the handlers of the paused
             * phase */
            axis2_phase_invoke_start_from_handler(phase, env, paused_handler_i, msg_ctx);
        }
        else
        {
            /* Now we have found the paused phase and invoked the rest of the
             * handlers of that phase, invoke all the phases after that */
            if(found_match)
            {
                axis2_phase_invoke(phase, env, msg_ctx);
            }
        }
    }

    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "End:axis2_engine_resume_invocation_phases");
    return AXIS2_SUCCESS;
}
コード例 #19
0
ファイル: main.c プロジェクト: Denisss025/wsfcpp
neethi_policy_t *AXIS2_CALL
merge_policylist(
    axutil_array_list_t * arraylist,
    const axutil_env_t * env)
{
    int i = 0;
    neethi_policy_t *policy = NULL;
    neethi_policy_t *result = NULL;

    result = (neethi_policy_t *) axutil_array_list_get(arraylist, env, 0);
    result =
        (neethi_policy_t *) neethi_engine_get_normalize(env, AXIS2_FALSE,
                                                        result);

    for (i = 1; i < axutil_array_list_size(arraylist, env); i++)
    {
        policy = (neethi_policy_t *) axutil_array_list_get(arraylist, env, i);
        policy =
            (neethi_policy_t *) neethi_engine_get_normalize(env, AXIS2_FALSE,
                                                            policy);
        result = (neethi_policy_t *) neethi_engine_merge(env, policy, result);
    }
    return result;
}
コード例 #20
0
AXIS2_EXTERN void AXIS2_CALL
axiom_soap_header_free(
    axiom_soap_header_t * soap_header,
    const axutil_env_t * env)
{

    if(soap_header->header_blocks)
    {
        axutil_hash_index_t *hi = NULL;
        void *val = NULL;
        for(hi = axutil_hash_first(soap_header->header_blocks, env); hi; hi = axutil_hash_next(env,
            hi))
        {
            axutil_hash_this(hi, NULL, NULL, &val);

            if(val)
            {
                axiom_soap_header_block_free((axiom_soap_header_block_t *)val, env);
                val = NULL;
            }
        }

        axutil_hash_free(soap_header->header_blocks, env);
    }
    if(soap_header->header_block_keys)
    {
        int size = 0;
        void *val = NULL;
        int i = 0;
        size = axutil_array_list_size(soap_header->header_block_keys, env);
        for(i = 0; i < size; i++)
        {
            val = axutil_array_list_get(soap_header->header_block_keys, env, i);
            if(val)
            {
                AXIS2_FREE(env->allocator, (char *)val);
                val = NULL;
            }
        }
        axutil_array_list_free(soap_header->header_block_keys, env);
        soap_header->header_block_keys = NULL;
    }
    AXIS2_FREE(env->allocator, soap_header);

    soap_header = NULL;

    return;
}
コード例 #21
0
axutil_array_list_t *AXIS2_CALL
sandesha2_permanent_invoker_mgr_find(
    sandesha2_invoker_mgr_t *invoker_mgr,
    const axutil_env_t *env,
    sandesha2_invoker_bean_t *bean)
{
    int i = 0;
    int size = 0;
    int match_list_size = 0;
    axutil_array_list_t *match_list = NULL;
    axutil_array_list_t *find_list = NULL;
    axis2_char_t *sql_find = NULL;
    axutil_array_list_t *ret = NULL;
    sandesha2_permanent_invoker_mgr_t *invoker_mgr_impl = NULL;
    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
        "[sandesha2]Entry:sandesha2_permanent_invoker_mgr_find");
    invoker_mgr_impl = SANDESHA2_INTF_TO_IMPL(invoker_mgr);
    sql_find = "select msg_ctx_ref_key,msg_no, seq_id,is_invoked from invoker;";
    find_list = sandesha2_permanent_bean_mgr_find(invoker_mgr_impl->bean_mgr, env, 
        sandesha2_invoker_find_callback, sql_find);
    if(find_list)
        size = axutil_array_list_size(find_list, env);
    if(!bean)
        return find_list;
    match_list = axutil_array_list_create(env, 0);
    for(i = 0; i < size; i++)
    {
        sandesha2_invoker_bean_t *candidate = NULL;
        candidate = (sandesha2_invoker_bean_t *) 
            axutil_array_list_get(find_list, env, i);
        if(sandesha2_permanent_invoker_mgr_match(invoker_mgr, env, bean, 
            candidate))
        {
            match_list_size++;
            axutil_array_list_add(match_list, env, candidate);
        }
        else
        {
            sandesha2_invoker_bean_free(candidate, env);
        }
    }
    if(find_list)
        axutil_array_list_free(find_list, env);

    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
        "[sandesha2]Exit:sandesha2_permanent_invoker_mgr_find");
    return ret;
}
コード例 #22
0
int calculateOptimizedPortfolioSSD(const axutil_env_t* env,axutil_array_list_t* symbols,axis2_char_t* benchmark,axutil_date_time_t* start,axutil_date_time_t* end,
				double solutions[],double& optValue)
{
	int retCode = 0;
	int numSymbols = axutil_array_list_size(symbols,env);
	ostringstream oss(ostringstream::out);
	AlmDataWriter* writer = new AlmDataWriter();
	for(int i=0;i<numSymbols;i++)
	{
		axis2_char_t* symbol = (axis2_char_t*)axutil_array_list_get(symbols,env,i);
		buildURLYahoo(env,symbol,start,end,oss);
		string url = oss.str();
		//oss.str("");
		vector<double> returns;
		AXIS2_LOG_INFO(env->log,"retrieving data from [%s]",url.c_str());
		DataRetriever::getReturnDataVector(url,returns);
		string stock = symbol;
		retCode = writer->addReturnData(stock,returns);
	}
	buildURLYahoo(env,benchmark,start,end,oss);

	string url = oss.str();
	oss.str("");
	AXIS2_LOG_INFO(env->log,"retrieving benchmark data from [%s]",url.c_str());
	vector<double> returns;
	DataRetriever::getReturnDataVector(url,returns);
	string stock = benchmark;
	writer->addBenchmarkReturnData(stock,returns);

	oss<<GlobalVariables::ALM_SSD_MOD<<"_"<<getpid()<<".dat";
	string dataFilename = oss.str();
	oss.str("");
	writer->writeSMLDataFileSSD(dataFilename);
	double nouse = -1;
	if(retCode == 0)
	{
		retCode = executeSMLOOPS(env,GlobalVariables::ALM_SSD_MOD,dataFilename,solutions,optValue,nouse);
		AXIS2_LOG_INFO(env->log,"returned from executeSMLOOPS");
	}
	else
	{
		AXIS2_LOG_INFO(env->log,"error happens -- not calling oops anymore...");
	}

	return retCode;
}
コード例 #23
0
axis2_status_t AXIS2_CALL
transport_token_process_alternatives(
    const axutil_env_t * env,
    neethi_all_t * all,
    rp_property_t * transport_token)
{

    neethi_operator_t *operator = NULL;
    axutil_array_list_t *arraylist = NULL;
    neethi_assertion_t *assertion = NULL;
    neethi_assertion_type_t type;
    void *value = NULL;

    int i = 0;

    arraylist = neethi_all_get_policy_components(all, env);

    for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
    {
        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
        value = neethi_assertion_get_value(assertion, env);
        type = neethi_assertion_get_type(assertion, env);

        if(value)
        {
            if(type == ASSERTION_TYPE_HTTPS_TOKEN)
            {
                rp_https_token_t *https_token = NULL;
                https_token = (rp_https_token_t *)neethi_assertion_get_value(assertion, env);
                if(https_token)
                {
                    rp_property_set_value(transport_token, env, https_token,
                        RP_PROPERTY_HTTPS_TOKEN);
                }
                else
                    return AXIS2_FAILURE;
            }
            else
                return AXIS2_FAILURE;
        }
        else
            return AXIS2_FAILURE;
    }
    return AXIS2_SUCCESS;
}
コード例 #24
0
static axis2_status_t AXIS2_CALL
username_token_process_alternatives(
    const axutil_env_t *env,
    neethi_all_t *all,
    rp_username_token_t *username_token)
{
    neethi_operator_t *operator = NULL;
    axutil_array_list_t *arraylist = NULL;
    neethi_assertion_t *assertion = NULL;
    neethi_assertion_type_t type;
    void *value = NULL;

    int i = 0;

    arraylist = neethi_all_get_policy_components(all, env);

    for (i = 0; i < axutil_array_list_size(arraylist, env); i++)
    {
        operator =(neethi_operator_t *) axutil_array_list_get(arraylist, env,
                                                              i);
        assertion =
            (neethi_assertion_t *) neethi_operator_get_value(operator, env);
        value = neethi_assertion_get_value(assertion, env);
        type = neethi_assertion_get_type(assertion, env);

        if (value)
        {
            if (type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_10)
            {
                rp_username_token_set_useUTprofile10(username_token, env,
                                                     AXIS2_TRUE);
            }
            else if (type == ASSERTION_TYPE_WSS_USERNAME_TOKEN_11)
            {
                rp_username_token_set_useUTprofile11(username_token, env,
                                                     AXIS2_TRUE);
            }
            else
                return AXIS2_FAILURE;
        }
        else
            return AXIS2_FAILURE;
    }
    return AXIS2_SUCCESS;
}
コード例 #25
0
AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_ws_info_list_init(
    axis2_ws_info_list_t * ws_info_list,
    const axutil_env_t * env)
{
    int size = 0;
    int i = 0;

    size = axutil_array_list_size(ws_info_list->ws_info_list, env);
    for(i = 0; i < size; i++)
    {
        axis2_ws_info_t *ws_info = NULL;

        ws_info = (axis2_ws_info_t *)axutil_array_list_get(ws_info_list->ws_info_list, env, i);
        axis2_ws_info_free(ws_info, env);
    }
    return AXIS2_SUCCESS;
}
コード例 #26
0
ファイル: comment_test.c プロジェクト: AdrianRys/wsf
int print_comments(const axutil_env_t *env,
        axutil_array_list_t *comments)
{
	axis2_char_t *user = NULL;
	axis2_char_t *text = NULL;
	remote_registry_comment_t *comment = NULL;
	int i = 0;

	for(i = 0; i < axutil_array_list_size(comments, env); i ++)
	{
		comment = (remote_registry_comment_t*)axutil_array_list_get(comments, env, i);
		user = remote_registry_comment_get_user(comment, env);
		text = remote_registry_comment_get_text(comment, env);

		printf("%s:\t\%s\n", user, text);
	}
	return 0;
}
コード例 #27
0
ファイル: query.c プロジェクト: alexis-gruet/kt_rampart
AXIS2_EXTERN axiom_node_t* AXIS2_CALL saml_autho_decision_query_to_om(saml_autho_decision_query_t *autho_decision_query, 
																	  axiom_node_t *parent, 
																	  const axutil_env_t *env)
{
	int size = 0, i = 0;
	axiom_element_t *e = NULL;
	axiom_node_t *n = NULL;	
	axiom_namespace_t *ns = NULL;
	axiom_attribute_t *attr = NULL;
	saml_action_t *action;

	ns = axiom_namespace_create(env, SAML_PROTOCOL_NMSP, SAML_PROTOCOL_PREFIX);
	e = axiom_element_create(env, parent, SAML_AUTHORIZATION_DECISION_QUERY, ns, &n);

	if(e)
	{
		if(autho_decision_query->subject)
			saml_subject_to_om(autho_decision_query->subject, n, env);

		if(autho_decision_query->resource)
		{
			attr = axiom_attribute_create(env, SAML_RESOURCE, autho_decision_query->resource, NULL);
			axiom_element_add_attribute(e, env, attr, n);
		}
		if(autho_decision_query->saml_actions)
		{
			size = axutil_array_list_size(autho_decision_query->saml_actions, env);

			for(i = 0 ; i < size ; i++)
			{
				action = (saml_action_t*)axutil_array_list_get(autho_decision_query->saml_actions, env, i);
				saml_action_to_om(action, n, env);
			}
		}
		if(autho_decision_query->evidence)
		{
			saml_evidence_to_om(autho_decision_query->evidence, n, env);
		}
	}
	return n;



}
コード例 #28
0
ファイル: exactlyone.c プロジェクト: Denisss025/wsfcpp
AXIS2_EXTERN axis2_status_t AXIS2_CALL
neethi_exactlyone_serialize(
    neethi_exactlyone_t *neethi_exactlyone,
    axiom_node_t *parent,
    const axutil_env_t *env)
{
    axiom_node_t *exactlyone_node = NULL;
    axiom_namespace_t *policy_ns = NULL;
    axutil_array_list_t *components = NULL;

    policy_ns = axiom_namespace_create(env, NEETHI_NAMESPACE, NEETHI_PREFIX);
    axiom_element_create(env, parent, NEETHI_EXACTLYONE, policy_ns,
        &exactlyone_node);
    if(!exactlyone_node)
    {
        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
            "Cannot create 'ExactlyOne' node. Serialization of 'ExactlyOne' assertion failed");
        return AXIS2_FAILURE;
    }

    components = neethi_exactlyone_get_policy_components(neethi_exactlyone, env);
    if(components)
    {
        axis2_status_t status = AXIS2_FAILURE;
        int i = 0;
        for(i = 0; i < axutil_array_list_size(components, env); i++)
        {
            neethi_operator_t *operator = NULL;
            operator = (neethi_operator_t *)axutil_array_list_get(components, env, i);
            if(operator)
            {
                status = neethi_operator_serialize(operator, env, exactlyone_node);
                if(status != AXIS2_SUCCESS)
                {
                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                        "Neethi operator serialization failed. "
                            "Cannot serialize 'ExactlyOne' assertion");
                    return AXIS2_FAILURE;
                }
            }
        }
    }
    return AXIS2_SUCCESS;
}
コード例 #29
0
axis2_status_t AXIS2_CALL
wss10_process_alternatives(
    const axutil_env_t *env,
    neethi_all_t *all,
    rp_wss10_t *wss10)
{
    neethi_operator_t *operator = NULL;
    axutil_array_list_t *arraylist = NULL;
    neethi_assertion_t *assertion = NULL;
    neethi_assertion_type_t type;
    void *value = NULL;

    int i = 0;

    arraylist = neethi_all_get_policy_components(all, env);

    for(i = 0; i < axutil_array_list_size(arraylist, env); i++)
    {
        operator = (neethi_operator_t *)axutil_array_list_get(arraylist, env, i);
        assertion = (neethi_assertion_t *)neethi_operator_get_value(operator, env);
        value = neethi_assertion_get_value(assertion, env);
        type = neethi_assertion_get_type(assertion, env);

        if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_KEY_IDENTIFIER)
        {
            rp_wss10_set_must_support_ref_key_identifier(wss10, env, AXIS2_TRUE);
        }
        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_ISSUER_SERIAL)
        {
            rp_wss10_set_must_support_ref_issuer_serial(wss10, env, AXIS2_TRUE);
        }
        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_EXTERNAL_URI)
        {
            rp_wss10_set_must_support_ref_external_uri(wss10, env, AXIS2_TRUE);
        }
        else if(type == ASSERTION_TYPE_MUST_SUPPORT_REF_EMBEDDED_TOKEN)
        {
            rp_wss10_set_must_support_ref_embedded_token(wss10, env, AXIS2_TRUE);
        }
        else
            return AXIS2_FAILURE;
    }
    return AXIS2_SUCCESS;
}
コード例 #30
0
ファイル: axis2_PortFolio.c プロジェクト: AdrianRys/wsf
        axis2_status_t AXIS2_CALL
        axis2_PortFolio_free (
                axis2_PortFolio_t* PortFolio,
                const axutil_env_t *env)
        {
            
            
                  int i = 0;
                  int count = 0;
                  void *element = NULL;
            

            AXIS2_ENV_CHECK(env, AXIS2_FAILURE);

            
                if ( PortFolio->attrib_portFolioItem != NULL)
                {
                    count = axutil_array_list_size( PortFolio->attrib_portFolioItem, env);
                    for( i = 0; i < count; i ++)
                    {
                       element = axutil_array_list_get( PortFolio->attrib_portFolioItem, env, i);
              
              if( element != NULL)
              {
                 
                 
                      axis2_PortFolioItem_free( (axis2_PortFolioItem_t*)element, env);
                   element = NULL;
              }

              
                    }
                    axutil_array_list_free( PortFolio->attrib_portFolioItem, env);
                }
              

            if(PortFolio)
            {
                AXIS2_FREE( env->allocator, PortFolio);
                PortFolio = NULL;
            }
            return AXIS2_SUCCESS;
        }