一周前,我使用"New Web service from WSDL“选项创建了一个新的Web服务。
现在更新了WSDL,即更改了类头。如何更新我的旧Web服务(7天前)以使用新类,而无需再次从WSDL中删除和创建web服务。是否有像“从WSDL编辑Web服务”或“重新生成WSDL”这样的选项?
注意:我使用Netbeans作为IDE。
在进阶时谢谢
发布于 2016-01-07 17:46:20
我将假设您在Netbeans中使用Maven。
如果您不知道名称,请在pom.xml中查找.wsdl文件。在本例中,只需在旧countries.wsdl上复制新的countries.wsdl文件即可。
如果WSDL具有新方法或被删除,则使NewWebServiceFromWSDL类实现endpointInterface中指定的接口(在本例中为xxx.BLAAPIPort)
在部署之前删除此实现。
Webservice Java代码示例。
@WebService(serviceName = "APIPortService", portName = "APIPortSoap11", endpointInterface = "xxx.BLAAPIPort"
public class NewWebServiceFromWSDL {仅供参考,Maven中的插件,当您单击“从WSDL新建Web服务”时生成:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlFiles>
<wsdlFile>localhost_8080/ws/countries.wsdl</wsdlFile>
</wsdlFiles>
<vmArgs>
<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
</vmArgs>
<staleFile>${project.build.directory}/jaxws/stale/countries.stale</staleFile>
</configuration>
<id>wsimport-generate-countries</id>
<phase>generate-sources</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>javax.xml</groupId>
<artifactId>webservices-api</artifactId>
<version>2.0</version>
</dependency>
</dependencies>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>true</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>https://stackoverflow.com/questions/34651254
复制相似问题