The following test works in JAXRSMultipartTest in systest/jaxrs:

POST /bookstore/books/image HTTP/1.1
Content-Type: multipart/mixed
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 127.0.0.1:8081
Content-Length: 2287

--g9ilY2cyv-BWnEJdQlNNX-mSdheEbMTSIySU_
Content-Disposition: form-data; name="image"; filename="testfile.png"
Content-Type: image/png; charset=ISO-8859-1
Content-Transfer-Encoding: binary

some binary content

--g9ilY2cyv-BWnEJdQlNNX-mSdheEbMTSIySU_--

and response:

HTTP/1.1 413 Request Entity Too Large
Date: Wed, 29 Feb 2012 16:09:14 GMT
Content-Length: 0
Server: Jetty(7.5.4.v20111024)


I think the reason it does not work in your case is that
the contextual properties are only applicable to the root part, which is a simple soap envelope in your case.

Try a system property "org.apache.cxf.io.CachedOutputStream.MaxSize" instead - definitely should work.
Alternatively try the patch available at:
https://issues.apache.org/jira/browse/CXF-4142

I think now it is actually safe to apply as the patch will be really applicable for non-root parts only.

Cheers, Sergey

On 29/02/12 11:59, mkserkan wrote:
Unfortunately, does not work.

CXF version : *2.5.1*

spring conf relating properties :

                *<jaxws:properties>
                        <entry key="schema-validation-enabled" value="false" />
                        <entry key="attachment-max-size" value="1000" />
                        <entry key="mtom-enabled" value="true" />
                </jaxws:properties>*

http raw request (SOAP UI):

*POST http://................ HTTP/1.1
Accept-Encoding: gzip,deflate
SOAPAction: "............."
Content-Type: multipart/related; type="application/xop+xml";
start="<[email protected]>"; start-info="text/xml";
boundary="----=_Part_98_4789609.1330516166058"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:8050
Content-Length: 25830182


------=_Part_98_4789609.1330516166058
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID:<[email protected]>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
    <soapenv:Header/>
    <soapenv:Body>
.
.
.
.
.
    </soapenv:Body>
</soapenv:Envelope>
------=_Part_98_4789609.1330516166058
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID:<xxxxx>

.
.
.
.
.
.
.
.
*


--
View this message in context: 
http://cxf.547215.n5.nabble.com/Is-it-possible-to-prevent-the-whole-content-to-be-uploaded-if-content-length-is-too-large-tp5522251p5524765.html
Sent from the cxf-user mailing list archive at Nabble.com.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to