gpt4 book ai didi

web-services - 如何使用 JAX-WS 生成 WSDL 2.0

转载 作者:行者123 更新时间:2023-12-04 14:31:07 25 4
gpt4 key购买 nike

这个问题可能很愚蠢,但我还没有找到一种方法来获取由 JAX-WS RI Web 服务生成的 WSDL 2.0。

我一直在使用最新的 jax-ws 版本,如果我创建一个非常简单的 WS(例如下面的示例),则生成的 WSDL 将是 1.1 版。

    @WebService
public interface RandomNumberGenerator {

Integer getRandomNumber();

}

@WebService(endpointInterface="RandomNumberGenerator")
public class RandomNumberGeneratorImpl {

public Integer getRandomNumber() {
return (int) (Math.random() * 1000);
}
}

有谁知道我如何明确告诉 JAX-WS 生成 WSDL 2.0?考虑到 2.0 是自 2007 年以来 W3C 的推荐标准,我非常有信心 JAX-WS 确实提供了一种生成它的方法。

谢谢。

最佳答案

I'm pretty confident JAX-WS does offer a way to generate it.



恐怕,它没有。引自 the JAX-WS 2.0 specification ,第 2 页,部分目标:

WSDL 2.0: The W3C is expected to progress WSDL 2.0[11] to Recommendation during the lifetime of this JSR. JAX-WS 2.0 will add support for WSDL 2.0 whilst requiring continued support for WSDL 1.1. Note: The expert group for the JSR decided against this goal for this release . We will look at adding support in a future revision of the JAX-WS specification.



这意味着 JAX-WS 2.0 中将没有 WSDL 2.0 支持,这就是引用实现不提供它的原因。 Afaik,目前在这方面没有太大进展。

如果您想要 WSDL 2.0 和 JAX-WS,您将不得不使用另一个堆栈,例如 Axis2 .

关于web-services - 如何使用 JAX-WS 生成 WSDL 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13432306/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com