Just FYI, I've logged a bug for the XmlSchema project:

http://issues.apache.org/jira/browse/WSCOMMONS-261

Dan


On Tuesday 16 October 2007, James Mao wrote:
> Sorry,
>
> False alarm, I'm testing against with the old distribution which not
> included Dan's fix
> The java2ws works perfect, I'll commit a test in java2ws soon
>
> Cheers,
> James
>
> > Hi Dan,
> >
> > Is it fix the java2ws tools as well, or just the runtime?
> > in the runtime the http header now should contain the
> > "application/octet-stream", right?
> >
> > But I tested with the java2ws, it's not working. the
> > expectedContentTypes="image/png" still missing in the schema
> >
> >
> > James
> >
> >> It's definitely a bug in XmlSchema.   Updating to the latest
> >> version of XmlSchema helped a little bit, but not enough.   It at
> >> least attempts to write the extensors.   The problem is the parsing
> >> only saves the last extensor.    I've worked around that bug by
> >> writing a Deserializer that actually works correctly so it should
> >> work now. Just committed the fix to trunk.
> >>
> >> Dan
> >>
> >> On Tuesday 16 October 2007, Daniel Kulp wrote:
> >>> OK.   Not a JAXB issue.   Seems to be an XmlSchema issue.   The
> >>> DOM we feed into XmlSchema contains the contenttype stuff.   If I
> >>> immediately print the schema, it's gone.   :-(
> >>>
> >>> Dan
> >>>
> >>> On Tuesday 16 October 2007, Daniel Kulp wrote:
> >>>> No, this is different.   That thread talks about parameters to
> >>>> the SEI methods that should be attachments.    In this case, this
> >>>> is a field inside one of the objects that is a parameter.   This
> >>>> SHOULD work. We just pass the object class as-is to JAXB so this
> >>>> seems to be a JAXB issue.
> >>>>
> >>>> Dan
> >>>>
> >>>> On Tuesday 16 October 2007, Jim Ma wrote:
> >>>>> This is not supported in CXF .
> >>>>> This thread FYI:
> >>>>> http://www.nabble.com/MTOM-sample-generated-WSDL-with-DataHandle
> >>>>>r- on -s erver-t4210895.html
> >>>>>
> >>>>> 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.xs
> >>>>>>d 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.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to