Hello,
I need some information about how we can use Axis2C and its apis to handle file
attachments. I did read a few links, but that did not help me.
I am using both Axis2C to consume and publish a web service.
On the client side, I am using the following snippet :
--------------------------------------------------------------------------------------------------------------------------
data_handler = NULL;
data_handler = axiom_data_handler_create(env, inreq0, mimeType);
data_text = axiom_text_create_with_data_handler(env, text_om_node,
data_handler, &sub_text_om_node);
axiom_text_set_optimize(data_text, env, AXIS2_TRUE);
--------------------------------------------------------------------------------------------------------------------------
On the publishing side
--------------------------------------------------------------------------------------------------------------------------
result = axiom_node_get_data_element(cn, env);
data_handler = axiom_text_get_data_handler((axiom_text_t *) result, env);
if (data_handler)
{
// My processing here
}
--------------------------------------------------------------------------------------------------------------------------
This code works properly if I set the enableMTOM to true in axis2.xml file.
But once I comment this line, my code doesnt work.
I want to send file as an attachment only, (not as a text within message).
Can you please tell me what could be going wrong.
If you can help me with some working client/ server code to exchange
attachments, it will help me all the more.
Rgds,
Ramesh