axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zengxianrui- (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2C-1509) The response message from axis2/c has not charSet in the ContentType(src/core/transport/http/server/apache2/apache2_out_transport_info.c).
Date Wed, 01 Dec 2010 02:42:14 GMT
The response message from axis2/c has not charSet in the ContentType(src/core/transport/http/server/apache2/apache2_out_transport_info.c).
------------------------------------------------------------------------------------------------------------------------------------------

                 Key: AXIS2C-1509
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1509
             Project: Axis2-C
          Issue Type: Bug
          Components: httpd module
    Affects Versions: 1.6.0
         Environment: all environments
            Reporter: zengxianrui- 


There are two functions in apache2_out_transport_info.c to set the charSet ant ContentType
of the response message: axis2_apache_out_transport_info_set_content_type & axis2_apache_out_transport_info_set_char_encoding.

When you use axis2_apache_out_transport_info_set_char_encoding to set the charSet, this function
don't converts the input parameter axis2_http_out_transport_info_t * info to axis2_apache2_out_transport_info_t*,
so the encoding is seted to the axis2_http_out_transport_info struct. But whe you use axis2_apache_out_transport_info_set_content_type
to set  the ContentType, this function converts the input parameter axis2_http_out_transport_info_t
* out_transport_info to axis2_apache2_out_transport_info_t*, so this function use axis2_apache2_out_transport_info
struct to get encoding, you know the encoding field in this struct is null, so we can't get
the correct encoding in the response message.

the two functions are:

axis2_status_t AXIS2_CALL
axis2_apache_out_transport_info_set_char_encoding(
    axis2_http_out_transport_info_t * info,
    const axutil_env_t * env,
    const axis2_char_t * encoding)
{
    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);

    if (info->encoding)
    {
        AXIS2_FREE(env->allocator, info->encoding);
    }
    info->encoding = axutil_strdup(env, encoding);

    return AXIS2_SUCCESS;
}


axis2_status_t AXIS2_CALL
axis2_apache_out_transport_info_set_content_type(
    axis2_http_out_transport_info_t * out_transport_info,
    const axutil_env_t * env,
    const axis2_char_t * content_type)
{
    axis2_apache2_out_transport_info_t *info = NULL;

    axis2_char_t *tmp1 = NULL;
    axis2_char_t *tmp2 = NULL;

    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
    AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
    info = AXIS2_INTF_TO_IMPL(out_transport_info);

    if (info->encoding)
    {

        tmp1 = axutil_stracat(env, content_type, ";charset=");
        tmp2 = axutil_stracat(env, tmp1, info->encoding);
        info->request->content_type = apr_pstrdup(info->request->pool, tmp2);
        AXIS2_FREE(env->allocator, tmp1);
        AXIS2_FREE(env->allocator, tmp2);
    }
    else
    {
        info->request->content_type = apr_pstrdup(info->request->pool,
                                                  content_type);
    }
    return AXIS2_SUCCESS;
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message