I didn't think that MTOM would "optimize" a string and send it as an
attachment. MTOM only optimizes binary data fields.
Why not just send the string as an element in the message?
Anne
On 8/22/06, Saminda Abeyruwan <[EMAIL PROTECTED]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
zolv wrote:
> Hi
>
> First of all. I read documentation(s) and I founded only one example how to
send an attachment using axis2. In fact, it shows only how to send an image from
file. There is no other documentation. This is not all. I noticed (maybe I'm
wrong) that in org.apache.axiom.attachments.utils package is only 1 usable class
that - ImageDataSource used in example. What with any others (class or examples)?
>
> Anyway.
>
> Is it possible to send String as attachment? (no, i don't have this string in
file etc - just pure String object).
> thanx for reply.
Yes, absolutely.
...
OMFactory fac = OMAbstractFactory.getOMFactory();
OMText txt = fac.createOMText("axis2");
txt.setOptimize(true);
...
or
byte[] array = "axis2".getBytes();
DataSource dataSource = new ByteArrayDataSource(array);
OMText txt1 = fac.createOMText(dataSource,true);
And set the option,
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
to ServiceClient's Option object.
Saminda
>
> frustrated zolv
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFE6xRxYmklbLuW6wYRAtGbAJ0dy0dZs1HuqrUcQL3jpSe6fJb5EwCdH16t
bjJj6Xt+EoGLDBeacoDMivw=
=FAgt
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]