-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anne Thomas Manes wrote:
> 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:
>
> 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);
Sorry i missed a one important thing, You have to encode the string to
base64 first in first option.
Ex:
OMText txt =
fac.createOMText(org.apache.axiom.om.util.Base64.encode("axis2".getBytes()));
txt.setOptimize(true);
Saminda
> ...
>
> 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]
>
>
>
>>
- ---------------------------------------------------------------------
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]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFE6/KzYmklbLuW6wYRAjnxAJ4kKTmwjtaCujzyenlKN7Lg92LybQCgpGtt
TFoMZ5oevBInZySkZb120So=
=41Qr
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]