Description
Mauro Molinari opened SWS-904 and commented
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}
Affects: 2.2.1
Issue Links:
- Improve the experience to enable MTOM with JAXB [SWS-905] #982 Improve the experience to enable MTOM with JAXB
("is superseded by")