我尝试从这个 WSDL生成存根(不是我的网络服务,所以我不能更改名称!)
问题是我无法成功生成存根,因为在 wsdl 中是服务名称,其不同之处仅在于带有“_”的服务开始而另一个不是。示例:_registerTest 和 registerTest
有人知道如何解决这个问题吗?是否可以使用 Jaxb 生成存根?
我尝试使用 Maven:
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<id>ws-source-gen-phase1</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<removeOldOutput>true</removeOldOutput>
<extension>true</extension>
<schemaDirectory>src/main/resources/</schemaDirectory>
<args>
<arg>-wsdl</arg>
<schemaFiles>src/main/resources/onyxexamservices.wsdl</schemaFiles>
<!-- <arg>-XautoNameResolution</arg> -->
</args>
<generatePackage>com.onyx.player.ws</generatePackage>
<generateDirectory>${project.build.directory}/generated-sources/xjc1</generateDirectory>
</configuration>
</execution>
</executions>
</plugin>
并使用 wsimport:
wsimport onyxexamservices.wsdl
parsing WSDL...
Generating code...
Compiling code...
/Users/blub/Downloads/./de/bps/plugin/webservice/server/OnyxExamService.java:89: error:
method registerTest(long,String,byte[],Mapwrapper) is already defined in interface
OnyxExamService
public long registerTest(
^
/Users/blub/Downloads/./de/bps/plugin/webservice/server/OnyxExamService.java:114: error:
method registerStudent(long,long,byte[],Mapwrapper) is already defined in interface
OnyxExamService
public long registerStudent(
^
/Users/blub/Downloads/./de/bps/plugin/webservice/server/OnyxExamService.java:165: error:
method testControl(long,StudentIdsWrapper,int,Mapwrapper) is already defined in interface
OnyxExamService
public long testControl(
^
/Users/blub/Downloads/./de/bps/plugin/webservice/server/OnyxExamService.java:210: error:
method deregisterTest(long,String,Mapwrapper) is already defined in interface
OnyxExamService
public long deregisterTest(
^
4 errors
compilation failed, errors should have been reported