Return-Path: Delivered-To: apmail-axis-c-user-archive@www.apache.org Received: (qmail 78621 invoked from network); 19 Sep 2010 08:42:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Sep 2010 08:42:28 -0000 Received: (qmail 75950 invoked by uid 500); 19 Sep 2010 08:42:28 -0000 Delivered-To: apmail-axis-c-user-archive@axis.apache.org Received: (qmail 75669 invoked by uid 500); 19 Sep 2010 08:42:24 -0000 Mailing-List: contact c-user-help@axis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache AXIS C User List" Delivered-To: mailing list c-user@axis.apache.org Received: (qmail 75661 invoked by uid 99); 19 Sep 2010 08:42:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Sep 2010 08:42:23 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [203.104.17.190] (HELO web94715.mail.in2.yahoo.com) (203.104.17.190) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 19 Sep 2010 08:42:17 +0000 Received: (qmail 19664 invoked by uid 60001); 19 Sep 2010 08:41:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1284885714; bh=nL+DF0G97ZS24F1eGNw+6zL6nLLeBOO5qJz0FNO4REw=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=H6ZMmCqq45g11y97SOm7W2qbsD/9vFWCfjVbX6i3nfHhkzbqAlY/XqKe7oBW/GhMK2ohjFBvg1PEvlsKbIGKDnUu8ebMtPE9j8z+euAISx/aIgD5SbG8DoBUVOSzHFbe+EJtM3mTapzqp5KZue6rAZpDr8x+ijzZMGlVxVoO9uU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=XDtjfWevLsLLpBoxa3WERn3yibmfuEfpwRQg1M/d+4G9t/T3V9B+KTjXDb+xUTREYFiaKKqwNsLjb608zPAl0lkzv/sdw9pEjUXOUF0OhzQcNd1t+aVSTfSqGzC0ub6QSZc8KaxU5Fc/gjC34jafU/uixsQEUmKeNxAp0kxlgNw=; Message-ID: <460578.19176.qm@web94715.mail.in2.yahoo.com> X-YMail-OSG: Nulbb4oVM1lv6GgrUnY99aF4iJ7xkTEQMELxof0YxupFETH 4uG_NMP.FU9gokkAdxE8DlHKiKwyK7i2XsVeNWWPMWooIWOwcVobSmF3gE7m SyeJBl300gRJMZ6V5VdLdNZDqRTyX.TZTt9LslJt1va1UoWsWAyaR.dETLeb nu0JMnbM1P87830iLYqekSQvS3BKToIlSsjFTDfcjhXakN.gZ4CWrY72jUWK NVAcSLJcNm3v7ChFNuE8IRNSZ_KsWnKpFpyj6qrxbtcEhMsx4eKGOewI86B7 9s3xzUlbqhod_lmCoeBGxqO7ElGN7t0gY Received: from [117.192.152.87] by web94715.mail.in2.yahoo.com via HTTP; Sun, 19 Sep 2010 14:11:54 IST X-Mailer: YahooMailClassic/11.4.9 YahooMailWebService/0.8.105.279950 Date: Sun, 19 Sep 2010 14:11:54 +0530 (IST) From: ramesh Gopal Subject: Re: Axis2C and MTOM ... How to use Axis2C to send/ receive attachments To: Apache AXIS C User List In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-696845067-1284885714=:19176" --0-696845067-1284885714=:19176 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I want to know more about receiving attachments. Rgds, Ramesh --- On Sat, 18/9/10, Nandika Jayawardana wrote: From: Nandika Jayawardana Subject: Re: Axis2C and MTOM ... How to use Axis2C to send/ receive attachm= ents To: "Apache AXIS C User List" Date: Saturday, 18 September, 2010, 11:23 AM If you want to send the file as an MTOM Attachment, you need to use the ena= bleMTOM property either enabled in axis2.xml or configured in message conte= xt.=A0You can use=A0axis2_msg_ctx_set_doing_mtom (msg_ctx, env, AXIS2_TRUE)= ;=A0=0A=0A to enable MTOM within your code. Have a look into the mtom samples availabl= e with axis2c. RegardsNandika=A0 On Fri, Sep 17, 2010 at 5:18 PM, ramesh Gopal wro= te: =0A=0A Hello, =0AI need some information about how we can use Axis2C and its apis to hand= le file attachments. I did read a few links, but that did not help me. =0A I am using both Axis2C to consume and publish a web service. On the client side, I am using the following snippet : ---------------------------------------------------------------------------= ----------------------------------------------- =0A=0Adata_handler =3D NULL; data_handler =3D axiom_data_handler_create(env, inreq0, mimeType); data_text =3D axiom_text_create_with_data_handler(env, text_om_node, data_h= andler, &sub_text_om_node); axiom_text_set_optimize(data_text, env, AXIS2_TRUE); =0A=0A---------------------------------------------------------------------= ----------------------------------------------------- On the publishing=0A side ---------------------------------------------------------------------------= ----------------------------------------------- result =3D axiom_node_get_data_element(cn, env); data_handler =3D axiom_text_get_data_handler((axiom_text_t *) result, env); =0A=0Aif (data_handler) { =A0=A0=A0=A0 // My processing here } ---------------------------------------------------------------------------= ----------------------------------------------- This code works properly if I set the enableMTOM to true in axis2.xml file. =0A=0A 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 attach= ments, it will help me all the more. =0A=0A Rgds, Ramesh --=20 http://nandikajayawardana.blogspot.com/ WSO2 Inc: http://www.wso2.com =0A=0A=0A=0A=0A=0A --0-696845067-1284885714=:19176 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable


I want to know more about receiving a= ttachments.

Rgds,
Ramesh

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

From: Nandika Jayawardana <jayawark@gmail.com>
Subjec= t: Re: Axis2C and MTOM ... How to use Axis2C to send/ receive attachmentsTo: "Apache AXIS C User List" <c-user@axis.apache.org>
Date: Sat= urday, 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.&nbs= p;
You can use 
axis2_msg_ctx_set_doing_mtom (msg_ctx, e= nv, AXIS2_TRUE); 
=0A=0A

to enable MTOM within= your code. Have a look into the mtom samples available with axis2c.
<= div>
Regards
Nandika 

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

Hel= lo,

=0AI need some information about how we can use Axis2C and its a= pis to handle file attachments. I did read a few links, but that did not he= lp me.
=0A
I am using both Axis2C to consume and publish a web servic= e.

On the client side, I am using the following snippet :

---= ---------------------------------------------------------------------------= --------------------------------------------
=0A=0Adata_handler =3D NULL= ;
data_handler =3D axiom_data_handler_create(env, inreq0, mimeType);
= data_text =3D axiom_text_create_with_data_handler(env, text_om_node, data_h= andler, &sub_text_om_node);
axiom_text_set_optimize(data_text, env, = AXIS2_TRUE);
=0A=0A-----------------------------------------------------= ---------------------------------------------------------------------
On the publishing=0A side
--------------------------------------------= ---------------------------------------------------------------------------= ---
result =3D axiom_node_get_data_element(cn, env);
data_handler =3D= axiom_text_get_data_handler((axiom_text_t *) result, env);
=0A=0Aif (da= ta_handler)
{
     // My processing here
}
= ---------------------------------------------------------------------------= -----------------------------------------------

This code works prop= erly if I set the enableMTOM to true in axis2.xml file.
=0A=0A
But on= ce 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 t= ell me what could be going wrong.

If you can help me with some worki= ng client/ server code to exchange attachments, it will help me all the mor= e.
=0A=0A
Rgds,
Ramesh





--
http://nandikajay= awardana.blogspot.com/
WSO2 Inc: http://www.wso2.com
=0A=0A=0A<= /div>=0A
--0-696845067-1284885714=:19176--