【问题标题】:jaxws:wsgen fails to find Web Servicejaxws:wsgen 找不到 Web 服务
【发布时间】:2013-02-17 22:31:44
【问题描述】:

我通过以下方式设置了 jaxws-maven-plugin:

        <plugin>
            <groupId>org.jvnet.jax-ws-commons</groupId>
            <artifactId>jaxws-maven-plugin</artifactId>
            <version>2.2</version>
            <executions>
                <execution>
                    <id>generate-wsdl-for-random-num-generator</id>
                    <goals>
                        <goal>wsgen</goal>
                    </goals>
                    <configuration>
                        <sei>mydomain.sib.RandomNumberGeneratorEndpoint</sei>
                        <destDir>${basedir}\wsdls\</destDir>
                    </configuration>
                </execution>
            </executions>
        </plugin>

当我尝试运行时:

mvn jaxws:wsgen

我收到以下错误:

[ERROR] Failed to execute goal org.jvnet.jax-ws-commons:jaxws-maven-plugin:2.2:w
sgen (default-cli) on project soap-ws: No @javax.jws.WebService found. -> [Help
1]

mydomain.sib.RandomNumberGeneratorEndpoint 确实有 @javax.jws.WebService 注释:

@WebService(endpointInterface = "mydomain.RandomNumberGenerator")
public class RandomNumberGeneratorEndpoint implements RandomNumberGenerator {

        public double getRandomNumber(long limit) {
            return Math.random() * limit;
        }

}

有人知道我的设置有什么问题吗?

干杯。

【问题讨论】:

    标签: maven jax-ws


    【解决方案1】:

    事实证明,问题相当简单:我错过了插件设置中的 genWsdl 标记。

    现在的设置如下:

        <configuration>
                <sei>mydomain.sib.RandomNumberGeneratorEndpoint</sei>
                <genWsdl>true</genWsdl>
                <resourceDestDir>${basedir}\wsdls\randomNumberGenerator</resourceDestDir>
        </configuration>
    

    当我阅读文档here 时,我确实看到了这个标签——但我没有意识到这是问题所在……我掉了球。

    无论如何,谢谢,希望这个答案有一天对某人有用。

    【讨论】:

      猜你喜欢
      • 2017-08-02
      • 2020-09-25
      • 1970-01-01
      • 2013-06-29
      • 1970-01-01
      • 1970-01-01
      • 2018-05-19
      • 2014-06-13
      • 2019-10-16
      相关资源
      最近更新 更多