I think you need a jaxws binding file:

<bindings
    xmlns:xsd="http://www.w3.org/2001/XMLSchema";
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
    wsdlLocation="swa-mime.wsdl"
    xmlns="http://java.sun.com/xml/ns/jaxws";>
    <bindings node="wsdl:definitions">
        <enableMIMEContent>true</enableMIMEContent>
    </bindings>
</bindings>


Dan





On Thursday, May 05, 2011 1:01:21 AM ext2 wrote:
> Hi:
>       I am try to write a client to invoke any existing SWA webservice;
> But the generated JAX-WS interface always using byte[] instead of
> DataHandler for the attachment?
>       how could  I configure cxf to using DataHandler instead of byte[]?
> 
>       Thanks any suggestion;
> 
> Following is  a simplified wsdl to illustrate the problem;
> <types>
> <xs:element name="sayHi" type="tns:sayHi"/>
> <xs:element name="sayHiResponse" type="tns:sayHiResponse"/>
> <xs:element name="attachment1" type="xs:base64Binary"/>
> <xs:element name="attachment2" type="xs:base64Binary"/>
> <types>
> 
>   <wsdl:message name="sayHi">
>     <wsdl:part element="tns:sayHi" name="parameters"/>
>     <wsdl:part element="tns:attachment1" name="attachment1"/>
>     <wsdl:part element="tns:attachment2" name="attachment2"/>
>   </wsdl:message>
> 
>       <wsdl:input name="sayHi">
>       <mime:multipartRelated>
>           <mime:part>
>             <soap:body parts="parameters" use="literal"/>
>           </mime:part>
>           <mime:part>
>             <mime:content part="attachment1"
> type="application/octet-stream"/>
>           </mime:part>
>           <mime:part>
>             <mime:content part="attachment2"
> type="application/octet-stream"/>
>           </mime:part>
>         </mime:multipartRelated>
>       </wsdl:input>

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog
Talend - http://www.talend.com

Reply via email to