0

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 JAX-RS endpoints, and set an mtom-enabled property.

My Spring config is:

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

And my 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();
dur
  • 15,689
  • 25
  • 79
  • 125
Pengyi Wang
  • 123
  • 1
  • 16

1 Answers1

1

Try this:

<beans>
    <jaxrs:server id="bookstore1">
        <jaxrs:properties>
            <entry key="mtom-enabled" value="true"/>
        </jaxrs:properties>
    </jaxrs:server>  
</beans>
dur
  • 15,689
  • 25
  • 79
  • 125
Andrew_WOT
  • 11
  • 2