如何更改jaxrs端点的属性以支持“mtom”

时间:2010-06-01 00:26:09

标签: rest cxf mtom

我创建了一个RESTful Web服务,我希望在没有SOAP的情况下将二进制文件发送到此服务。

CXF网站上有一些信息: XOP

但我找不到获取CXF JAX-RS端点的方法,并设置mtom-enabled属性。

我的Spring配置是:

<jaxrs:server id="fis" address="http://172.20.41.40:8080/fis">
    <jaxrs:serviceBeans>
        <ref bean="FaultInfoResource" />
        <ref bean="ExplorationResultResource" />
    </jaxrs:serviceBeans>  
</jaxrs:server> 

<bean id="FaultInfoService"  parent="baseService" class="com.dfe.demo.FaultInfoService">
</bean>
<bean id="FaultInfoResource" class="com.dfe.demo.FaultInfoResource">
  <property name="faultInfoService" ref="FaultInfoService"/>
</bean> 

<bean id="ExplorationResultService"  parent="baseService" class="com.dfe.demo.ExplorationResultService">
</bean>
<bean id="ExplorationResultResource" class="com.dfe.demo.ExplorationResultResource">
  <property name="explorationResultService" ref="ExplorationResultService"/>
</bean>

我的服务器类是:

ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(new String[]{"com/dfe/iss/config/applicationContext.xml","com/dfe/demo/yearlyplan/cxf-servlet.xml"});
JAXRSServerFactoryBean fib = (JAXRSServerFactoryBean) ctx.getBean("fis");
fib.create();

1 个答案:

答案 0 :(得分:1)

试试这个:

<beans>
    <jaxrs:server id="bookstore1">
        <jaxrs:properties>
            <entry key="mtom-enabled" value="true"/>
        </jaxrs:properties>
    </jaxrs:server>  
</beans>
相关问题