Как мне изменить свойство конечной точки jaxrs для поддержки "mtom" - PullRequest
0 голосов
/ 01 июня 2010

Я создал веб-сервис RESTful и хочу отправить двоичные файлы в этот сервис без 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 Ответ

1 голос
/ 19 июня 2010

Попробуйте это:

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