2010-06-01 16 views
0

J'ai créé un service Web RESTful et je souhaite envoyer des fichiers binaires à ce service sans utiliser SOAP.Comment modifier la propriété de jaxrs endpoint pour prendre en charge "mtom"

Il y a quelques informations sur le site CXF: XOP

Mais je ne peux pas trouver un moyen d'obtenir les CXF JAX-RS points de terminaison, et définir une propriété mtom-enabled.

Ma config Spring est:

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

Et ma classe de serveur est:

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

Répondre

1

Essayez ceci:

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