简体   繁体   English

从XSD和WSDL生成Java代码

[英]Generate Java code from XSD and WSDL

I have a folder containing multiple xsd, and wsdl files. 我有一个包含多个xsd和wsdl文件的文件夹。 How do I use all of them to generate Java classes? 如何使用它们全部生成Java类? I know how to generate java code from a single wsdl file, but I have multiple xsds and wsdls 我知道如何从单个wsdl文件生成Java代码,但是我有多个xsds和wsdls

If you are using maven then this will work for you. 如果您使用的是maven,那么它将为您工作。 You probably won't need the bindingDirectory or bindingFiles argument but just in case there is an example. 您可能不需要bindingDirectory或bindingFiles参数,但以防万一有一个例子。

             <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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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