Announcement Announcement Module
No announcement yet.
Mtom + axiom + jaxb Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mtom + axiom + jaxb

    I am trying to use the Spring webservice (1.5.9) + JAXB (2.1.5) as data binding. I want to use MTOM for binary data optimization.

    I used the mtom sample provide in spring ws download.

    That sample works great when using SAAJ Message factory. But if i use the axiom message factory I run into one issue -->

    1. storeImage operation works fine. This case the client is sending the mtom message. The axiom + jaxb is able to unmarshal it to java object.
    2. readImage operation whoever, the image in response is sent out the as base 64 encoded text, instead of mtom attachement. Even though on the JAXB marshaller mtom is enabled.

    When i look at, i see outputFormat.setDoOptimize(true);, I believe this tell the axiom to do mtom.

    So how I do this in configuration file?

    Right now the only way its seems to do this is programmatic way - extend axiom message factory and get handle to output message format and set this attribute.

    Below is my configuration file attached.

    Any help would be appreciated.. Thanks Shrikant

    ************************************************** ******

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="" xmlns:xsi=""

    <bean id="imageRepository" class=" .StubImageRepository"/>

    <bean class=" eRepositoryEndpoint">
    <constructor-arg ref="imageRepository"/>

    <!-- -->
    <bean id="messageFactory" class=" MessageFactory">
    <property name="payloadCaching" value="false" />
    <!-- -->

    <bean class=" ing.PayloadRootAnnotationMethodEndpointMapping"/>

    <bean class=" ter.GenericMarshallingMethodEndpointAdapter">
    <constructor-arg ref="marshaller"/>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value=""/>
    <property name="mtomEnabled" value="true"/>

    <bean id="mtom" class=" sdl11Definition">
    <property name="schema" ref="schema"/>
    <property name="portTypeName" value="ImageRepository"/>
    <property name="locationUri" value="http://localhost:8080/mtom/"/>

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="/WEB-INF/schema.xsd"/>