I'm wondering if it might be possible to run the wsdl2java stuff on a slightly modified wsdl. An XSLT could likely take the original WSDL, replace the expectectContentTypes with something like:
> <xs:element name="content" type="xs:base64Binary" > xmime:expectedContentTypes="image/jpeg, image/png, image/gif, > application/octet-stream"/> and then run the wsdl2java on that modified WSDL. That should then get the DataHandler instead. The runtime and everything could still use the original WSDL. Dan On Sep 21, 2012, at 9:42 AM, Marcel Stör <[email protected]> wrote: > On 21.09.2012 15:33, Glen Mazza wrote: >> On 09/21/2012 08:08 AM, Marcel Stör wrote: >>> The bad news: >>> d) Since we run wsdl2java in each an every Maven build a) isn't an >>> option anyway. >>> >> >> wsdl2java should be able to generate DataHandlers within method >> signatures, my MTOM/Apache FOP tutorial[1] will generate the following >> service endpoint interface for uploading/downloading PDFs: > > Yes, that's because you use > xmime:expectedContentTypes="application/octet-stream" in the WSDL/XSD. > > In addition to my image attachment I also have a CSV attachment type with a > text/csv MIME type. For this class the content attribute is a DataHandler. > > <xs:complexType name="csvAttachment"> > <xs:complexContent> > <xs:extension base="me:attachment"> > <xs:sequence> > <xs:element name="content" type="xs:base64Binary" > xmime:expectedContentTypes="text/csv"/> > </xs:sequence> > </xs:extension> > </xs:complexContent> > </xs:complexType> > <xs:complexType name="imageAttachment"> > <xs:complexContent> > <xs:extension base="me:attachment"> > <xs:sequence> > <xs:element name="content" type="xs:base64Binary" > xmime:expectedContentTypes="image/jpeg, image/png, image/gif"/> > </xs:sequence> > </xs:extension> > </xs:complexContent> > </xs:complexType> > > public class CsvAttachment extends Attachment { > @XmlElement(required = true) > @XmlMimeType("text/csv") > protected DataHandler content; > > public class ImageAttachment extends Attachment { > @XmlElement(required = true) > @XmlMimeType("image/*") > protected Image content; > > Cheers, > Marcel -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
