Beispiel #1
0
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
neethi_assertion_is_empty(
    neethi_assertion_t *neethi_assertion,
    const axutil_env_t *env)
{
    return axutil_array_list_is_empty(neethi_assertion->policy_components, env);
}
Beispiel #2
0
AXIS2_EXTERN axis2_bool_t AXIS2_CALL
neethi_exactlyone_is_empty(
    neethi_exactlyone_t *exactlyone,
    const axutil_env_t *env)
{
    return axutil_array_list_is_empty(exactlyone->policy_components, env);
}
Beispiel #3
0
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;
}
Beispiel #4
0
axis2_status_t 
wsclient_output_http_headers (const axutil_env_t *env,
							  axis2_svc_client_t *svc_client,
							  axis2_char_t *file_name)
{
	axis2_op_client_t *op_client;
	axis2_msg_ctx_t *msg_ctx;
	axis2_http_client_t *client = NULL;
	axutil_property_t *client_property;
	axis2_http_simple_response_t *response = NULL;
	axutil_array_list_t *list = NULL;
	axis2_http_header_t *header;
	FILE *file;
	int i;

	op_client = axis2_svc_client_get_op_client(svc_client, env);
	if (op_client)
	{
		msg_ctx = (axis2_msg_ctx_t *)
			axis2_op_client_get_msg_ctx (op_client,
										 env, 
										 AXIS2_WSDL_MESSAGE_LABEL_OUT);

		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 AXIS2_FAILURE;

		if (client)
			response = axis2_http_client_get_response (client, env);
		else
			return AXIS2_FAILURE;

		if (response)
			list = axis2_http_simple_response_get_headers (response, env);
		else 
			return AXIS2_FAILURE;

		if (list)
		{
			if (!axutil_array_list_is_empty (list, env))
			{
				if (file_name)
				{
					file = fopen (file_name, "w");
					if (!file)
						return AXIS2_FAILURE;
				}
				else
					file = stdout;

				for (i = 0; i < axutil_array_list_size (list, env); i++)
				{
					header = (axis2_http_header_t *)axutil_array_list_get (list, env, i);
					fputs (axis2_http_header_to_external_form (header, env), file);
				}
				fclose (file);
			}
		}
		else
			return AXIS2_FAILURE;
	}
	return AXIS2_SUCCESS;
}