You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Forum User <te...@gmail.com> on 2013/03/20 06:53:58 UTC

MTOM not enabled on client but enabled on server

Hi,
I have a question about MTOM.

I have MTOM enabled on server and my wsdl defines the element as
<xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" minOccurs="0" name
="attachment" ns1:expectedContentTypes="application/octet-stream"type="
xs:base64Binary"/>

and on the client side, my MTOM feature is *not* enabled and i am using

DataSource ds = new FileDataSource(f);

request.setAttachment(new DataHandler(ds));


and the attachment is sent inline with the soap request. Not as a
multipart. This causes my server to run outOfMemory if the file size is
big.

Is this the right behavior? if yes, this makes MTOM feature almost
un-reliable from server side as we don't have any control over the client.
Please clarify the concept for me.Is there anyway we can restrict our
client to send files as attachments?

Thanks,

Sam

Re: MTOM not enabled on client but enabled on server

Posted by Stefan Magnus Landrø <st...@gmail.com>.
You could add a servlet filter/interceptor that blocks non-http multipart
requests. It will give you some protection against accidental submission of
large XML documents.

Stefan

tirsdag 23. april 2013 skrev Jérôme Revillard følgende:

> Hi,
>
> Ok... this is not really good then as the server can simply run out of
> memory if the client is not well coded.
> Any chance to improve it in some future releases ?
>
> Thanks.
> Jérôme
>
> Le 23/04/2013 13:05, Stefan Magnus Landrø a écrit :
> > Hi Jérôme,
> >
> > You have to fix it client side. Setting mtom on the server will only
> affect how responses are sent on the wire (e.g. when you return binary
> content as part of your response)
> >
> > Hth
> >
> > Stefan
> >
> > Sendt fra min iPhone
> >
> > Den 23. apr. 2013 kl. 11:32 skrev Jérôme Revillard <
> jrevillard@gnubila.fr <javascript:;>>:
> >
> >> Hi,
> >>
> >> No news about it ? I'm also interested to know if we can fix it server
> >> side ...
> >>
> >> Best,
> >> Jerome
> >>
> >> Le 20/03/2013 06:53, Forum User a écrit :
> >>> Hi,
> >>> I have a question about MTOM.
> >>>
> >>> I have MTOM enabled on server and my wsdl defines the element as
> >>> <xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime"
> minOccurs="0" name
> >>> ="attachment" ns1:expectedContentTypes="application/octet-stream"type="
> >>> xs:base64Binary"/>
> >>>
> >>> and on the client side, my MTOM feature is *not* enabled and i am using
> >>>
> >>> DataSource ds = new FileDataSource(f);
> >>>
> >>> request.setAttachment(new DataHandler(ds));
> >>>
> >>>
> >>> and the attachment is sent inline with the soap request. Not as a
> >>> multipart. This causes my server to run outOfMemory if the file size is
> >>> big.
> >>>
> >>> Is this the right behavior? if yes, this makes MTOM feature almost
> >>> un-reliable from server side as we don't have any control over the
> client.
> >>> Please clarify the concept for me.Is there anyway we can restrict our
> >>> client to send files as attachments?
> >>>
> >>> Thanks,
> >>>
> >>> Sam
>
>

-- 
BEKK Open
http://open.bekk.no

TesTcl - a unit test framework for iRules
http://testcl.com

Re: MTOM not enabled on client but enabled on server

Posted by Jérôme Revillard <jr...@gnubila.fr>.
Hi,

Ok... this is not really good then as the server can simply run out of
memory if the client is not well coded.
Any chance to improve it in some future releases ?

Thanks.
Jérôme

Le 23/04/2013 13:05, Stefan Magnus Landrø a écrit :
> Hi Jérôme,
>
> You have to fix it client side. Setting mtom on the server will only affect how responses are sent on the wire (e.g. when you return binary content as part of your response)
>
> Hth
>
> Stefan
>
> Sendt fra min iPhone
>
> Den 23. apr. 2013 kl. 11:32 skrev Jérôme Revillard <jr...@gnubila.fr>:
>
>> Hi,
>>
>> No news about it ? I'm also interested to know if we can fix it server
>> side ...
>>
>> Best,
>> Jerome
>>
>> Le 20/03/2013 06:53, Forum User a écrit :
>>> Hi,
>>> I have a question about MTOM.
>>>
>>> I have MTOM enabled on server and my wsdl defines the element as
>>> <xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" minOccurs="0" name
>>> ="attachment" ns1:expectedContentTypes="application/octet-stream"type="
>>> xs:base64Binary"/>
>>>
>>> and on the client side, my MTOM feature is *not* enabled and i am using
>>>
>>> DataSource ds = new FileDataSource(f);
>>>
>>> request.setAttachment(new DataHandler(ds));
>>>
>>>
>>> and the attachment is sent inline with the soap request. Not as a
>>> multipart. This causes my server to run outOfMemory if the file size is
>>> big.
>>>
>>> Is this the right behavior? if yes, this makes MTOM feature almost
>>> un-reliable from server side as we don't have any control over the client.
>>> Please clarify the concept for me.Is there anyway we can restrict our
>>> client to send files as attachments?
>>>
>>> Thanks,
>>>
>>> Sam


Re: MTOM not enabled on client but enabled on server

Posted by Stefan Magnus Landrø <st...@gmail.com>.
Hi Jérôme,

You have to fix it client side. Setting mtom on the server will only affect how responses are sent on the wire (e.g. when you return binary content as part of your response)

Hth

Stefan

Sendt fra min iPhone

Den 23. apr. 2013 kl. 11:32 skrev Jérôme Revillard <jr...@gnubila.fr>:

> Hi,
> 
> No news about it ? I'm also interested to know if we can fix it server
> side ...
> 
> Best,
> Jerome
> 
> Le 20/03/2013 06:53, Forum User a écrit :
>> Hi,
>> I have a question about MTOM.
>> 
>> I have MTOM enabled on server and my wsdl defines the element as
>> <xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" minOccurs="0" name
>> ="attachment" ns1:expectedContentTypes="application/octet-stream"type="
>> xs:base64Binary"/>
>> 
>> and on the client side, my MTOM feature is *not* enabled and i am using
>> 
>> DataSource ds = new FileDataSource(f);
>> 
>> request.setAttachment(new DataHandler(ds));
>> 
>> 
>> and the attachment is sent inline with the soap request. Not as a
>> multipart. This causes my server to run outOfMemory if the file size is
>> big.
>> 
>> Is this the right behavior? if yes, this makes MTOM feature almost
>> un-reliable from server side as we don't have any control over the client.
>> Please clarify the concept for me.Is there anyway we can restrict our
>> client to send files as attachments?
>> 
>> Thanks,
>> 
>> Sam
> 

Re: MTOM not enabled on client but enabled on server

Posted by Jérôme Revillard <jr...@gnubila.fr>.
Hi,

No news about it ? I'm also interested to know if we can fix it server
side ...

Best,
Jerome

Le 20/03/2013 06:53, Forum User a écrit :
> Hi,
> I have a question about MTOM.
>
> I have MTOM enabled on server and my wsdl defines the element as
> <xs:element xmlns:ns1="http://www.w3.org/2005/05/xmlmime" minOccurs="0" name
> ="attachment" ns1:expectedContentTypes="application/octet-stream"type="
> xs:base64Binary"/>
>
> and on the client side, my MTOM feature is *not* enabled and i am using
>
> DataSource ds = new FileDataSource(f);
>
> request.setAttachment(new DataHandler(ds));
>
>
> and the attachment is sent inline with the soap request. Not as a
> multipart. This causes my server to run outOfMemory if the file size is
> big.
>
> Is this the right behavior? if yes, this makes MTOM feature almost
> un-reliable from server side as we don't have any control over the client.
> Please clarify the concept for me.Is there anyway we can restrict our
> client to send files as attachments?
>
> Thanks,
>
> Sam
>