JAX-WS error on WSDL file: “Error resolving component 's:schema'”

前端 未结 5 955
我寻月下人不归
我寻月下人不归 2020-12-28 15:25

The Error

I am using wsimport in a Java project to generate sources for three SOAP web services. The first two work fine: I use the JAX-WS Maven plugin to grab the

5条回答
  •  梦谈多话
    2020-12-28 15:53

    I solved this by adapting Vivek Pandey's method to Maven, while updating to the jaxws-maven-plugin 2.2. I'll reiterate it here for posterity:

    Summary

    Put this XJB customization file (see below) in your default binding files directory, and set wsimport to bind it and http://www.w3.org/2001/XMLSchema.xsd .

    XJB Customization

    The contents of the aforementioned XML file, xsd.xjb, that should go in your default binding files directory, is as follows (credit goes to Kohsuke):

    
    
    
      
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
      
        
      
    
    

    POM

    Here's the relevant part of my POM file, with changes noted:

    
        
        org.jvnet.jax-ws-commons
        jaxws-maven-plugin
        2.2
        
             
                
                    wsimport
                
                
                    
                    
                        -bhttp://www.w3.org/2001/XMLSchema.xsd
                    
                    
                        erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
                    
                    http://erp-app-devel.srv.mycompany.ca/EgTestReportEngine/Service.asmx.wsdl
                    ${project.build.directory}/jaxws/stale/Service.asmx.stale
                    
                    
                        xsd.xjb
                    
                
                wsimport-generate-egtestreportengine
                generate-sources
            
        
        
            
                javax.xml
                webservices-api
                1.4
            
        
        
            ${project.build.directory}/generated-sources/jaxws-wsimport
            true
            true
            true
            ${basedir}/src/jax-ws-catalog.xml
            2.0
        
    
    

提交回复
热议问题