我正在尝试从 WSDL 文件(WSDL 文件 + 少数 XSD 文件)生成 JAVA 存根类。我无法为 XSD Schema 和 Package 提供映射选项。
我有多个来自 ant 的模式包。我在 Maven 中尝试同样的方法,但找不到方法。
蚂蚁脚本
<axis-wsdl2java>
<mapping namespace="ABCD" package="com.XXX.1_X.a.b.c.d"/>
<mapping namespace="XYZ" package="com.XXX.1_X.x.y.z"/>
</axis-wsdl2java>
项目结构
+---src
| \---main
| +---java
| | \---com
| | \---explore
| | \---soap
| | \---client
| | ServletInitializer.java
| | SoapClientApplication.java
| |
| +---resources
| | | application.properties
| | |
| | +---static
| | +---templates
| | \---wsdl
| | \---1.X
| | SampleWSDL.WSDL
| | SampleXSD1.XSD
| | SampleXSD2.XSD
| | SampleXSD3.XSD
聚甲醛
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.2</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.explore</groupId>
<artifactId>soap-client</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<name>soap-client</name>
<description>Soap Service Client</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<configuration>
<wsdlDirectory>${project.basedir}/src/main/resources/wsdl/1.X</wsdlDirectory>
<wsdlFiles>
<wsdlFile>SampleWSDL.WSDL</wsdlFile>
</wsdlFiles>
<packageName>com.explore.soap.client.1_X.stubs</packageName>
</configuration>
</plugin>
</plugins>
</build>
</project>
请帮我找到添加多个模式的方法 - 包映射