CXF webService大文件傳輸 服務(wù)端設(shè)置

  • 服務(wù)端
    大文件傳輸時,CXF官方文檔寫的是默認128M http://cxf.apache.org/docs/security.html
    超過會報以下錯誤:
    org.apache.cxf.interceptor.Fault: Unmarshalling Error: Text size limit (134217728) exceeded
    需要注意的是,此時客戶端可能會報:
    cxf生成客戶端:java.io.IOException: Error writing request body to server
    axis2生成客戶端:socket write error
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws"
    xsi:schemaLocation="
    http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"
    xmlns:cxf="http://cxf.apache.org/core">

    <import resource="classpath:META-INF/cxf/cxf.xml" />
    <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />

    <cxf:bus>
        <cxf:properties>
            <!-- 定義上傳文件的最大長度,限制為256M -->
            <entry key="org.apache.cxf.stax.maxTextLength" value="268435456" />
        </cxf:properties>
    </cxf:bus>
</beans>
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容