Stream MTOM Web Services in Spring Web Services Framework

孤者浪人 提交于 2019-12-04 07:24:50

Yesterday, I am having the same problem with uploading large files. Finally I was able to find the solution for that. Spring WS has an customized Axiom message factory called org.springframework.ws.soap.axiom.AxiomSoapMessageFactory which can use file instead of in memory while uploading large files. The only change to do in your configuration is define the bean with your custom properties.

<bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory">
    <property name="payloadCaching" value="false" />
    <property name="attachmentCaching" value="true" />
    <property name="attachmentCacheThreshold" value="1024"/>
</bean>

Once you have this configuration and Axiom classes available in classpath, Spring-ws automatically uses temporary files to piggy back large document uploads.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!