CXF webService大文件传输 服务端设置

  • 服务端
    大文件传输时,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>
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容