axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramesh Gopal <fatuzorin2...@yahoo.com>
Subject Re: Axis2C and MTOM ... How to use Axis2C to send/ receive attachments
Date Sun, 19 Sep 2010 08:41:54 GMT


I want to know more about receiving attachments.

Rgds,
Ramesh

--- On Sat, 18/9/10, Nandika Jayawardana <jayawark@gmail.com> wrote:

From: Nandika Jayawardana <jayawark@gmail.com>
Subject: Re: Axis2C and MTOM ... How to use Axis2C to send/ receive attachments
To: "Apache AXIS C User List" <c-user@axis.apache.org>
Date: Saturday, 18 September, 2010, 11:23 AM

If you want to send the file as an MTOM Attachment, you need to use the enableMTOM property
either enabled in axis2.xml or configured in message context. You can use axis2_msg_ctx_set_doing_mtom
(msg_ctx, env, AXIS2_TRUE); 


to enable MTOM within your code. Have a look into the mtom samples available with axis2c.
RegardsNandika 



On Fri, Sep 17, 2010 at 5:18 PM, ramesh Gopal <fatuzorin2001@yahoo.com> wrote:



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





-- 
http://nandikajayawardana.blogspot.com/
WSO2 Inc: http://www.wso2.com







Mime
View raw message