axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Danushka Menikkumbura <danus...@wso2.com>
Subject Re: Service client options to set custom HTTP headers
Date Thu, 04 Sep 2008 04:53:57 GMT

> So if I use the new proposed interface to add a custom http header, how
> will I free the custom headers (or all http headers) after
> axis2_svc_client_send_receive?
> Is there going to be an API to free custom headers as well?
>   
Yes. We will have the following API calls.

    /**
     * Adds a custom HTTP header that should be included in the current 
request.
     * @param options Pointer to the options struct
     * @param env      Pointer to environment struct
     * @param name      Pointer to the string buffer containing the 
header name.
     *                  The caller has the ownership of this pointer
     * @param value      Pointer to the string buffer containing the 
header value.
     *                  The caller has the ownership of this pointer
     * @return AXIS2_FAILURE if there was an error or AXIS2_SUCCESS 
otherwise
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_options_add_custom_http_header(
        axis2_options_t*    options,
        const axutil_env_t*    env,
        const axis2_char_t*    name,
        const axis2_char_t*    value);

    /**
     * Get pointer to custom HTTP header array list.
     * @param options Pointer to the options struct
     * @param env      Pointer to environment struct
     * @return value of options->custom_http_headers
     */
    AXIS2_EXTERN axutil_array_list_t* AXIS2_CALL
    axis2_options_get_custom_http_header_list(
        const axis2_options_t* options,
        const axutil_env_t*       env);

    /**
     * Removes the given custom HTTP header.
     * @param options Pointer to the options struct
     * @param env      Pointer to environment struct
     * @param name      Pointer to the string buffer containing the 
header name.
     *                  The caller has the ownership of this pointer
     * @return AXIS2_FAILURE if there was an error or AXIS2_SUCCESS 
otherwise
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_options_remove_custom_http_header(
        axis2_options_t*    options,
        const axutil_env_t*    env,
        const axis2_char_t*    name);

    /**
     * Removes all the custom HTTP headers. This method should be called 
before
     * every client request that needs to have a new set of custom headers.
     * @param options Pointer to the options struct
     * @param env      Pointer to environment struct
     * @return AXIS2_FAILURE if there was an error or AXIS2_SUCCESS 
otherwise
     */
    AXIS2_EXTERN axis2_status_t AXIS2_CALL
    axis2_options_remove_all_custom_http_headers(
        axis2_options_t*    options,
        const axutil_env_t* env);

-- 
Danushka Menikkumbura
Technical Lead, WSO2 Inc.

blog : http://danushka-menikkumbura.blogspot.com/

http://wso2.com/ - "The Open Source SOA Company"



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message