Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-904

Improve the experience to enable MTOM with JAXB

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: Core, Documentation, Samples
    • Labels:
      None

      Description

      I had a very poor experience trying to enable MTOM attachment handling on a receiving endpoint expecting JAXB input parameters. Please let me write the whole story.

      I have to receive web service requests as defined by the following contract: http://www.fatturapa.gov.it/export/fatturazione/sdi/ws/trasmissione/v1.0/TrasmissioneFatture_v1.1.wsdl
      and the imported schema: http://www.fatturapa.gov.it/export/fatturazione/sdi/ws/trasmissione/v1.0/TrasmissioneTypes_v1.1.xsd

      With the following configuration I could make it almost work:

      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      	xmlns:web-services="http://www.springframework.org/schema/web-services"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xsi:schemaLocation="http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services-2.0.xsd
      		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
      		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"
      	default-lazy-init="true">
       
      	<context:component-scan base-package="it.dcssrl.fatturapa.sdi" />
      	<web-services:annotation-driven />
       
      	<!-- Expose the TrasmissioneFatture web service - to receive incoming messages from 
      		the SDI -->
      	<web-services:static-wsdl id="TrasmissioneFatture"
      		location="classpath:/wsdl/TrasmissioneFatture_v1.1.wsdl" />
       
      	<bean id="TrasmissioneTypes_v1.1" class="org.springframework.xml.xsd.SimpleXsdSchema">
      		<property name="xsd" value="classpath:/wsdl/TrasmissioneTypes_v1.1.xsd" />
      	</bean>
      </beans>

      @Endpoint
      public class TrasmissioneFattureEndpoint {
       
        @SoapAction("http://www.fatturapa.it/TrasmissioneFatture/RicevutaConsegna")
        public void ricevutaConsegna(@RequestPayload FileSdIType input) {
          // processing
        }

      where FileSdiType is a Java class generated by running the JAXB compiler XJC against the above XSD file. Please note that FileSdiType is annotated with @XmlType and not with XmlRootElement.
      Contrary to what the reference documentation says, unmarshalling for {{FileSdType}

        Issue Links

          Activity

          mauromol Mauro Molinari created issue -
          Hide
          mauromol Mauro Molinari added a comment -

          Please delete this issue: I hit the Enter key by error and I can't edit it any more!
          I will open a new issue will the full description.

          Show
          mauromol Mauro Molinari added a comment - Please delete this issue: I hit the Enter key by error and I can't edit it any more! I will open a new issue will the full description.
          Hide
          arjen.poutsma Arjen Poutsma added a comment -

          Closed as requested

          Show
          arjen.poutsma Arjen Poutsma added a comment - Closed as requested
          arjen.poutsma Arjen Poutsma made changes -
          Field Original Value New Value
          Resolution Invalid [ 6 ]
          Status Open [ 1 ] Closed [ 6 ]
          Hide
          mauromol Mauro Molinari added a comment -

          Thank you Arjen and sorry for my mistake

          I opened SWS-905 with the whole description. Maybe you want to link this to it.

          Show
          mauromol Mauro Molinari added a comment - Thank you Arjen and sorry for my mistake I opened SWS-905 with the whole description. Maybe you want to link this to it.
          arjen.poutsma Arjen Poutsma made changes -
          Link This issue is superseded by SWS-905 [ SWS-905 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          43m 48s 1 Arjen Poutsma 08/Jul/15 4:51 AM

            People

            • Assignee:
              Unassigned
              Reporter:
              mauromol Mauro Molinari
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: