2010-06-01 27 views
0

我创建了一个RESTful Web服务,并且我想在不使用SOAP的情况下将二进制文件发送到此服务。如何更改jaxrs端点的属性以支持“mtom”

上有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

试试这个:

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