Hi,
As per the discussion [1], you need use @RequestWrapper/@ResponseWrapper
to point to your wrapper bean FicheroXML in your SEI class.
[1]
http://www.nabble.com/MTOM-sample-generated-WSDL-with-DataHandler-on-server-t4210895.html
Best Regards
Freeman
imorales wrote:
Hi all.
I´m trying to implemente a web service that uses MTOM Attachments. The way
I´m doing is "Annotation if JAXB bean". The problem is that the wsdl that I
generate with ant task "java2wsdl" doesn´t add the annotation
@XmlMimeType("application/octet-stream") in the <wsdl:types>.
My bean is:
----------------------------------------------------------------------------
@XmlType
public class FicheroXML {
private String title;
@XmlMimeType("application/octet-stream")
private DataHandler xmlData;
public String getTitle() {return title; }
public void setTitle(String title) {this.title = title; }
@XmlTransient public DataHandler getXmlData() { return xmlData;}
public void setXmlData(DataHandler xmlData) {this.xmlData = xmlData;}
}
----------------------------------------------------------------------------
My service is:
----------------------------------------------------------------------------
@WebService
public interface ServicioFormularios {
@WebResult(name="uuid")
String guardaFormulario(@WebParam(name="xml")FicheroXML xml);
}
----------------------------------------------------------------------------
My cxf configuration is:
----------------------------------------------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<jaxws:endpoint
id="servicioFormulario"
implementor="com.servicios.ServicioFormulariosImpl"
address="/servicioFormulario">
<jaxws:properties>
<entry key="mtom-enabled" value="true"/>
</jaxws:properties>
</jaxws:endpoint>
</beans>
----------------------------------------------------------------------------
The wsdl generated whit java2wsdl:
----------------------------------------------------------------------------
.
..
...
<xs:complexType name="ficheroXML">
<xs:sequence>
<xs:element minOccurs="0" name="xmlData" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="title" type="xs:string"/>
</xs:sequence>
</xs:complexType>
...
..
.
<xs:complexType name="guardaFormulario">
<xs:sequence>
<xs:element minOccurs="0" name="xml" type="ficheroXML"/>
</xs:sequence>
</xs:complexType>
...
..
.
----------------------------------------------------------------------------
Why the attribute (xmime:expectedContentTypes="application/octet-stream")
isn´t in the "xmlData" element of "FicheroXML" ?
Any ideas ... it seam like the annotation @XmlMimeType it´s not running.
Thanks in advance.