美文网首页
CXF webService大文件传输 服务端设置

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

作者: 嘿小逗比就是你 | 来源:发表于2018-06-19 10:46 被阅读0次
  • 服务端
    大文件传输时,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>

相关文章

网友评论

      本文标题:CXF webService大文件传输 服务端设置

      本文链接:https://www.haomeiwen.com/subject/lrfaeftx.html