tags:

views:

156

answers:

1

I created a RESTful web service, and i want to send binary files to this service without soap.

There are some information on CXF website: XOP

But i can't find a way to get the CXF jaxrs endpoints,and set an "mtom-enabled" property.

My Spring config is:

<jaxrs:server id="fis" address="http://172.20.41.40:8080/fis"&gt;
<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> 

And i server class is:

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();
A: 

Try this


    <beans><jaxrs:server id="bookstore1">
     <jaxrs:properties>
         <entry key="mtom-enabled" value="true"/>
     </jaxrs:properties>
  </jaxrs:server>  
</beans>
Andrew_WOT
thanks,it works. And i write a post about it in Chinese.http://www.rocwing.com/cxf-mtom-for-rest-style-attachments/
rocwing