简体   繁体   中英

Generate Java code from XSD and WSDL

I have a folder containing multiple xsd, and wsdl files. How do I use all of them to generate Java classes? I know how to generate java code from a single wsdl file, but I have multiple xsds and wsdls

If you are using maven then this will work for you. You probably won't need the bindingDirectory or bindingFiles argument but just in case there is an example.

             <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jaxb2-maven-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                                <execution>
                                        <id>submitOrderRequest</id>
                                        <goals>
                                                <goal>xjc</goal>
                                        </goals>
                                        <configuration>
                                                <extension>true</extension>
                                                <schemaDirectory>src/main/resources/xsd/</schemaDirectory>
                                                <schemaFiles>submitOrderRequest.xsd</schemaFiles>
                                                <bindingDirectory>${project.basedir}/src/main/resources/xjb</bindingDirectory>
                                                <bindingFiles>submitOrderRequest.xjb</bindingFiles>
                                                <removeOldOutput>false</removeOldOutput>
                                                <clearOutputDir>false</clearOutputDir>
                                        </configuration>
                                </execution>
                            </executions>

                    </plugin>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM