You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Boxiong Ding <bo...@yahoo.com> on 2008/06/09 21:00:32 UTC
Does MTOM keep filename?
I have a service that uses MTOM to send a image file. As a client I can get the data, but the file name is lost. I have tried to set it in ByteArrayDataSource.setName() and create a DataHandler using it on server side. But still, the client always get null from DataSource.getName() and when I use tcpmon to look at the traffic, I couldn't find the file name any where.
Is this how it works? And how can I preserver the file name?
Thanks,
Boxiong
Re: Does MTOM keep filename?
Posted by Daniel Kulp <dk...@apache.org>.
Yea, in general, the name is considered a system dependent property
and the client should get to chose what makes sense for them . If the
name is important, it should be transferred in the actual data.
I suppose we COULD throw the name into a mime header on the part, but
we'd be the only toolkit to really do that or understand that. Thus,
it wouldn't exactly be portable.
Dan
On Jun 9, 2008, at 3:10 PM, Glen Mazza wrote:
>
> Pardon the non-answer, but for my MTOM example
> (http://www.jroller.com/gmazza/date/20071102), in step #11, I let
> the client
> set the name. Wouldn't it seem more natural to let the client
> decide what
> it wants the file it obtains to be called?
>
> As an alternative, perhaps best to send a separate String element
> for the
> filename in the SOAP response, then your client can name the file
> based on
> that name. Perhaps even a more portable solution.
>
> Glen
>
>
> Boxiong Ding wrote:
>>
>> I have a service that uses MTOM to send a image file. As a client I
>> can
>> get the data, but the file name is lost. I have tried to set it in
>> ByteArrayDataSource.setName() and create a DataHandler using it on
>> server
>> side. But still, the client always get null from
>> DataSource.getName() and
>> when I use tcpmon to look at the traffic, I couldn't find the file
>> name
>> any where.
>>
>> Is this how it works? And how can I preserver the file name?
>>
>> Thanks,
>> Boxiong
>>
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Does-MTOM-keep-filename--tp17739479p17739632.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog
Re: Does MTOM keep filename?
Posted by Benson Margulies <bi...@gmail.com>.
>From a protocol standpoint, the MTOM wire protocol does not carry a file
name. The fact that the data handler class carries a pathname is a bit of a
red herring. If you want to carry a file name, use another element.
It seems to me that there is some hypothetical possibility that the XOP/Mime
part could carry a file name, but I don't see a viable way to carry that
around. Similiarly, XOP could use a URL other than cid: to refer to some
other kind of resource, but I don't know if that would count as MTOM.
On Mon, Jun 9, 2008 at 3:10 PM, Glen Mazza <gl...@gmail.com> wrote:
>
> Pardon the non-answer, but for my MTOM example
> (http://www.jroller.com/gmazza/date/20071102), in step #11, I let the
> client
> set the name. Wouldn't it seem more natural to let the client decide what
> it wants the file it obtains to be called?
>
> As an alternative, perhaps best to send a separate String element for the
> filename in the SOAP response, then your client can name the file based on
> that name. Perhaps even a more portable solution.
>
> Glen
>
>
> Boxiong Ding wrote:
> >
> > I have a service that uses MTOM to send a image file. As a client I can
> > get the data, but the file name is lost. I have tried to set it in
> > ByteArrayDataSource.setName() and create a DataHandler using it on server
> > side. But still, the client always get null from DataSource.getName() and
> > when I use tcpmon to look at the traffic, I couldn't find the file name
> > any where.
> >
> > Is this how it works? And how can I preserver the file name?
> >
> > Thanks,
> > Boxiong
> >
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Does-MTOM-keep-filename--tp17739479p17739632.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
Re: Does MTOM keep filename?
Posted by Glen Mazza <gl...@gmail.com>.
Pardon the non-answer, but for my MTOM example
(http://www.jroller.com/gmazza/date/20071102), in step #11, I let the client
set the name. Wouldn't it seem more natural to let the client decide what
it wants the file it obtains to be called?
As an alternative, perhaps best to send a separate String element for the
filename in the SOAP response, then your client can name the file based on
that name. Perhaps even a more portable solution.
Glen
Boxiong Ding wrote:
>
> I have a service that uses MTOM to send a image file. As a client I can
> get the data, but the file name is lost. I have tried to set it in
> ByteArrayDataSource.setName() and create a DataHandler using it on server
> side. But still, the client always get null from DataSource.getName() and
> when I use tcpmon to look at the traffic, I couldn't find the file name
> any where.
>
> Is this how it works? And how can I preserver the file name?
>
> Thanks,
> Boxiong
>
>
>
>
>
--
View this message in context: http://www.nabble.com/Does-MTOM-keep-filename--tp17739479p17739632.html
Sent from the cxf-user mailing list archive at Nabble.com.