Ejemplo n.º 1
0
axis2_status_t AXIS2_CALL
axis2_tcp_server_init(
    axis2_transport_receiver_t * server,
    const axutil_env_t * env,
    axis2_conf_ctx_t * conf_ctx,
    axis2_transport_in_desc_t * in_desc)
{
    axis2_tcp_server_impl_t *server_impl = NULL;
    axis2_char_t *port_str = NULL;
    axutil_param_t *param = NULL;

    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    server_impl = AXIS2_INTF_TO_IMPL(server);

    server_impl->conf_ctx = conf_ctx;
    param =
        (axutil_param_t *)
        axutil_param_container_get_param(axis2_transport_in_desc_param_container
                                         (in_desc, env), env, "port");
    if (param)
    {
        port_str = axutil_param_get_value(param, env);
    }
    if (port_str)
    {
        server_impl->port = atoi(port_str);
    }
    return AXIS2_SUCCESS;
}
Ejemplo n.º 2
0
axis2_status_t AXIS2_CALL
axis2_udp_receiver_init(
    axis2_transport_receiver_t * tr_receiver,
    const axutil_env_t * env,
    axis2_conf_ctx_t * conf_ctx,
    axis2_transport_in_desc_t * in_desc)
{
	axis2_udp_receiver_impl_t *receiver = NULL;
	axis2_char_t *str = NULL;
	axutil_param_t *param = NULL;
	axutil_param_container_t *container = NULL;

	receiver = AXIS2_INTF_TO_IMPL(tr_receiver);
	receiver->conf_ctx = conf_ctx;
	container = axis2_transport_in_desc_param_container(in_desc, env);

	/* Get the port */
	param = (axutil_param_t *) axutil_param_container_get_param(container, env, AXIS2_PORT_STRING);	
	if (param)
	{
		str = (axis2_char_t *)axutil_param_get_value(param, env);
		if (str)
		{
			receiver->port = atoi(str);
		}
	}
	
	/* Get the multicast group */
	param = (axutil_param_t *) axutil_param_container_get_param(container, env, 
		AXIS2_UDP_TRANSPORT_MULTICAST_GROUP);
	if (param)
	{
		receiver->multicast_group = (axis2_char_t *)axutil_param_get_value(param, env);
		receiver->is_multicast = AXIS2_TRUE;
	}
	/* Get the max packet size */
	param = (axutil_param_t *) axutil_param_container_get_param(container, env, 
		AXIS2_UDP_TRANSPORT_MAX_PACKET_SIZE_STR);
	if (param)
	{
		str = (axis2_char_t *)axutil_param_get_value(param, env);
		if (str)
		{
			receiver->max_packet_size = atoi(str);
		} 	
	}
	return AXIS2_SUCCESS;
}
Ejemplo n.º 3
0
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_amqp_util_get_in_desc_conf_value_string(
    axis2_transport_in_desc_t* in_desc,
    const axutil_env_t* env,
    const axis2_char_t* param_name)
{
    axutil_param_t* param = NULL;
    axis2_char_t* value = NULL;

    param = (axutil_param_t*)axutil_param_container_get_param(
        axis2_transport_in_desc_param_container(in_desc, env), env, param_name);
    if(param)
    {
        value = axutil_param_get_value(param, env);
    }

    return value;
}
Ejemplo n.º 4
0
void
axis2_svc_client_set_http_info(
    axis2_svc_client_t * svc_client,
    const axutil_env_t * env,
    axis2_msg_ctx_t * msg_ctx)
{
    axis2_transport_in_desc_t *transport_in = NULL;
    axutil_param_t *expose_headers_param = NULL;
    axis2_bool_t expose_headers = AXIS2_FALSE;

    if(msg_ctx)
    {
        transport_in = axis2_msg_ctx_get_transport_in_desc(msg_ctx, env);
        if(transport_in)
        {
            expose_headers_param = axutil_param_container_get_param(
                axis2_transport_in_desc_param_container(transport_in, env), env,
                AXIS2_EXPOSE_HEADERS);
        }
        if(expose_headers_param)
        {
            axis2_char_t *expose_headers_value = NULL;
            expose_headers_value = axutil_param_get_value(expose_headers_param, env);
            if(expose_headers_value && 0 == axutil_strcasecmp(expose_headers_value,
                AXIS2_VALUE_TRUE))
            {
                expose_headers = AXIS2_TRUE;
            }
        }
    }
    if(expose_headers)
    {
        if(svc_client->http_headers == axis2_msg_ctx_get_http_output_headers(msg_ctx, env))
        {
            svc_client->http_status_code = axis2_msg_ctx_get_status_code(msg_ctx, env);
            return;
        }
    }

    if(svc_client->http_headers)
    {
        axis2_http_header_t *header = NULL;
        while(axutil_array_list_size(svc_client->http_headers, env))
        {
            header = (axis2_http_header_t *)axutil_array_list_remove(svc_client->http_headers, env,
                0);
            if(header)
            {
                axis2_http_header_free(header, env);
            }
        }
        axutil_array_list_free(svc_client->http_headers, env);
        svc_client->http_headers = NULL;
    }
    svc_client->http_status_code = 0;

    if(msg_ctx)
    {
        if(expose_headers)
        {
            svc_client->http_headers = axis2_msg_ctx_extract_http_output_headers(msg_ctx, env);
        }
        svc_client->http_status_code = axis2_msg_ctx_get_status_code(msg_ctx, env);
    }
}