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

  • MTOM issue with Spring -WS

    Hello,

    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

    Code:
    SOAPBinding binding = (SOAPBinding) ((BindingProvider)imageRepository).getBinding();
    
    binding.setMTOMEnabled(true);
    
    ((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..

    Thanks,

    Paren

  • #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="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
    
        <bean id="imageRepository" class="org.springframework.ws.samples.mtom.service.StubImageRepository"/>
    
        <bean class="org.springframework.ws.samples.mtom.ws.ImageRepositoryEndpoint">
            <constructor-arg ref="imageRepository"/>
        </bean>
        
        <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"/>
    
        <bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
            <constructor-arg ref="marshaller"/>
        </bean>
    
        <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
            <property name="contextPath" value="org.springframework.ws.samples.mtom.schema"/>
            <property name="mtomEnabled" value="true"/>
        </bean>
    
        <bean id="mtom" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
            <property name="builder">
                <bean class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
                    <property name="schema" value="/WEB-INF/schema.xsd"/>
                    <property name="portTypeName" value="ImageRepository"/>
                    <property name="locationUri" value="http://localhost:9000/mtom/"/>
                </bean>
            </property>
        </bean>
    
    </beans>
    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

    Comment


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

      Thanks

      Regards
      Paren

      Comment

      Working...
      X