Is it possible to generate serializable classes with CXF?

后端 未结 3 750
无人及你
无人及你 2020-12-31 09:30

I\'m using Apache CXF to generate classes from a WSDL file but they don\'t implement Serializable which is needed to put an object into a JMS queue. Is it possible to do thi

3条回答
  •  醉酒成梦
    2020-12-31 10:20

    I found the solution myself so here it is if anybody needs it in the future:

    1. add this plugin to pom.xml

    
        org.apache.cxf
        cxf-codegen-plugin
        ${cxf.version}
        
            
                generate-sources
                generate-sources
                
                    ${basedir}/src/main/java
                    ${basedir}/src/main/resources
                    
                        *Service.wsdl
                    
                    
                        
                            ${basedir}/src/main/resources/your_wsdl.wsdl
                            
                                -client
                                -impl
                                -server
                                -verbose
                                -validate
                            
                            
                                ${basedir}/src/main/resources/binding.xml
                            
                        
                    
                
                
                    wsdl2java
                
            
        
    
    

    2. write a custom binding (binding.xml)

    
    
        
            
                
            
        
    
    

    3. run 'mvn generate-sources'

提交回复
热议问题