I had exactly the same problem with cxf and swf. And here is the solution you
need:

<?xml version="1.0" encoding="UTF-8"?>
<jaxws:bindings wsdlLocation="YOUR_WSDL_LOCATION"
        xmlns:jaxws="http://java.sun.com/xml/ns/jaxws";
        xmlns:xs="http://www.w3.org/2001/XMLSchema";
        xmlns:jxb="http://java.sun.com/xml/ns/jaxb";
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
        <jaxws:bindings
        
node="wsdl:definitions/wsdl:types/xs:[EMAIL PROTECTED]'YOUR_TARGET_NAMESPACE']">
                <jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb";
                        xmlns:xs="http://www.w3.org/2001/XMLSchema";> 
                        <jxb:serializable/>
                </jxb:globalBindings>
        </jaxws:bindings>
</jaxws:bindings>

I hope it works for you too.

Regards,
Akos



daniel.mfreitas wrote:
> 
> Hello. I want to use wsdl2java to generate the client stubs to be used by
> my client web application. I am using Spring Web Flow and it requires that
> objects used in the flow are Serializable.
> 
> I successfully generated Serializable classes using the following bindings
> file and Metro JAXWS RI implementation:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
> xmlns:jaxb="http://java.sun.com/xml/ns/jaxb";
>       xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc";
> elementFormDefault="qualified" attributeFormDefault="unqualified"
>       jaxb:extensionBindingPrefixes="xjc" jaxb:version="1.0">
>       <xs:annotation>
>               <xs:appinfo>
>                       <jaxb:globalBindings>
>                               <xjc:serializable uid="-6026937020915831338"/>
>                       </jaxb:globalBindings>
>               </xs:appinfo>
>       </xs:annotation>
> </xs:schema>
> 
> But because of some limitations of Metro RI, we want to switch to CXF.
> When calling wsdl2java from a maven build file and we try to supply the
> above binding file, cfx throws
> 
> WSDLToJava Error : Unknown external binding files:
> 
> This is not a FileNotFoundError. wsdl2java does find the file, but it
> seems it does not understand its contents. I wanted to use CXF for
> everything including java2wsdl and wsdl2java. We have bad experiences to
> set up JAXWS Metro RI and for some developers it is a pain to put it to
> work. 
> 
> So how can I make the entities stubs to implement serializable with
> wsdl2java?
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-make-classes-created-from-wsdl2java-implements-serializable--tp14246207p15062180.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to