- 服务端
大文件传输时,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>
网友评论