Announcement Announcement Module
No announcement yet.
MTOM issue with Spring -WS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • MTOM issue with Spring -WS


    I am trying to get the samples mtom webservice provided in Spring-WS samples.

    The service as such works but it seems there is some inherent issue in which spring-ws handles attachments.

    I tried using the java client code and I used tcpmon to monitor the incoming request. Even though mtom is enabled as per code below

    SOAPBinding binding = (SOAPBinding) ((BindingProvider)imageRepository).getBinding();
    ((BindingProvider) imageRepository).getRequestContext().put(JAXWSProperties.MTOM_THRESHOLOD_VALUE, 10);
    The java client sends the Image file (attachment)as base64 encoded instead of binary. Ideally it should be sending the attachments as binary and not as base64 encoded.

    I tried calling the same webservice from .net 3.5 and setting the encoding as MTOM. The service does not save the attachment. It just does not acknowledge the binary attachments send from .NET client.

    If I set the encoding to text the service just works fine..

    Am I doing anything wrong here .. I have used the sample provide but I am unable to get the binary attachments working.

    Any inputs would be highly appreciated..



  • #2
    Spring WS

    The issue seems to be the sample spring mtom webservice. The service does not accept MTOM messages with binry attachments.. Only base64 encoded works.

    My spring-ws.xml looks like

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="" xmlns:xsi=""
        <bean id="imageRepository" class=""/>
        <bean class="">
            <constructor-arg ref="imageRepository"/>
        <bean class=""/>
        <bean class="">
            <constructor-arg ref="marshaller"/>
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="contextPath" value=""/>
            <property name="mtomEnabled" value="true"/>
        <bean id="mtom" class="">
            <property name="builder">
                <bean class="">
                    <property name="schema" value="/WEB-INF/schema.xsd"/>
                    <property name="portTypeName" value="ImageRepository"/>
                    <property name="locationUri" value="http://localhost:9000/mtom/"/>
    Is there any open JIRA issue on this ? Is it being solved in newer version of spring ws ? I am using spring 1.0.2


    • #3
      Issue fixed in Spring WS 1.5.5

      I have upgraded the sample code to spring ws 1.5.5 and the sample works fine..

      Was this an issue in spring 1.0.2 . What I want to know is is there an intermediate release I can use between 1.0.2 and 1.5.5.. I am bit wary about upgrading to Spring ws 1.5.5