axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malinda Kaushalye Kapuruge (JIRA)" <>
Subject [jira] Created: (AXIS2C-635) The axiom data handler returns incorrect length
Date Thu, 05 Jul 2007 10:10:05 GMT
The axiom data handler returns incorrect length

                 Key: AXIS2C-635
             Project: Axis2-C
          Issue Type: Bug
          Components: xml/om
         Environment: UNIX
            Reporter: Malinda Kaushalye Kapuruge

Call to axiom_data_handler_read_from(*****, length) returns incorrect value for the length.

When I send a message as follows[1] the content returns by the above method contains EOL characters.
If the service echos the MIME content the response contains these characters. Here[2] is my
server program.


content-transfer-encoding: binary

content-id: <>

content-type: application/octet-stream



axis2_mtom_mtom(const axutil_env_t *env, axiom_node_t *node)
    axiom_node_t *ret_node = NULL;
    axiom_node_t *array_node = NULL;

    array_node = axiom_node_get_first_child(node, env);
        axiom_node_t *inc_node = NULL;
        inc_node = axiom_node_get_first_child(array_node, env);
            axiom_node_t *binary_node = NULL;
            binary_node = axiom_node_get_first_child(inc_node, env);
                axiom_data_handler_t *data_handler = NULL;
                axiom_text_t *bin_text = (axiom_text_t *)
                axiom_node_get_data_element(binary_node, env);
                data_handler = axiom_text_get_data_handler(bin_text, env);
                if (data_handler)
                    axis2_char_t *text_str = NULL;
                    int length;
                    /*text_str = axiom_data_handler_get_content_type(data_handler, env);*/
                    /*text_str = axiom_data_handler_get_input_stream(data_handler, env);*/
                    axiom_data_handler_read_from(data_handler, env, &text_str, &length
                    printf("Str[%d]= %s", length-2, text_str);
                    ret_node = build_om_programatically(env, text_str);

    return ret_node;

/* Builds the response content */
axiom_node_t *
build_om_programatically(const axutil_env_t *env, axis2_char_t *text)
    axiom_node_t *mtom_om_node = NULL;
    axiom_element_t* mtom_om_ele = NULL;
    axiom_node_t *mtom2_om_node = NULL;
    axiom_element_t* mtom2_om_ele = NULL;
    axiom_namespace_t *ns1 = NULL;

    ns1 = axiom_namespace_create(env, "", "ns1");

    mtom_om_ele = axiom_element_create(env, NULL, "EchoBinaryAsStringResponse", ns1, &mtom_om_node);
    mtom2_om_ele = axiom_element_create(env, mtom_om_node, "EchoBinaryAsStringResult", ns1,

    axiom_element_set_text(mtom2_om_ele, env, text, mtom2_om_node);

    return mtom_om_node;

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:
For additional commands, e-mail:

View raw message