Has anyone had any luck getting WSDL2Java to automatically generate a type
mapping which uses the JAFDataHandlerSerializer/Deserializer factory objects
for javax.activation.DataHandler objects?  Here are the schemas that I'm
using:

DataHandler.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
        targetNamespace="http://activation.javax"; 
        xmlns:tns="http://types.retrieval.services.jgateway.lexisnexis.com"; 
        elementFormDefault="qualified" 
        attributeFormDefault="unqualified" 
        version="1.0">

   <!-- Define Types -->
   <complexType name="DataHandler">
      <sequence/>
   </complexType>

</schema>

DocRetrieve.xsd:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
 
targetNamespace="http://types.retrieval.services.jgateway.lexisnexis.com"; 
        xmlns:tns="http://types.retrieval.services.jgateway.lexisnexis.com"; 
        xmlns:activation="http://activation.javax"; 
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
        elementFormDefault="qualified" 
        attributeFormDefault="unqualified" 
        version="1.0">

   <import namespace="http://activation.javax";  
 
schemaLocation="http://localhost:8080/Jgateway/schemas/retrieval/DataHandler
.xsd"/>
   ...

   <complexType name="DocumentList">
      <sequence>
         <element name="document" type="activation:DataHandler"
maxOccurs="25"/>
      </sequence>
   </complexType>

   ...

</schema>

By default, the type mappings which are generated from this schema use the
generic BeanSerializer/Deserializer factories, which in turn does not
generate a MIME response.  

e.g.   <typeMapping
        xmlns:ns="http://activation.javax";
        qname="ns:DataHandler"
        type="java:javax.activation.DataHandler"
        serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
        deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
        encodingStyle=""
      />

If I change these mappings to use the JAFDataHandlerSerializer/Deserializer
factories, things work as they should.  Why doesn't the emitter use this
mapping by default for DataHandler types?

Thanks,
Joe Riess
Sr. Software Engineer
Electronic Product Development, LexisNexis
(937) 865-1730


Reply via email to