有什么方法可以使用 JAX-WS 从 Javadoc 生成 WSDL 文档吗?

发布于 2024-08-11 13:40:19 字数 1268 浏览 5 评论 0原文

我希望有某种扩展可以做到这一点(尽管我认为我的希望是愚蠢的乐观)。

   /**
     * <p>
     * Gets the {@link ResultObject} given the identifier. The following
     * fields are not available for some users and will contain a null value:
     * </p>
     * 
     * <ul>
     * <li>{@code resultObject.comment}</li>
     * <li>{@code resultObject.anotherObject.actionById}</li>
     * <li>{@code resultObject.anotherObject.actionByName}</li>
     * </ul>
     * 
     * <p>
     * The {@code daysInPurgatory} value will be {@code -1} when not
     * applicable
     * </p>
     * 
     * @param requestUser
     *            the user initiating the request
     * @param identifier
     *            the id of the ResultObject
     * @return the {@link ResultObject} or {@code null} if none exists
     * @throws SomeException
     *             if the {@code identifier} is {@code null}
     */
    @WebMethod
    @WebResult(name = "resultObject")
    public ResultObject getResultObjectById(
     @WebParam(name = "RequestUser", header = true, partName = "RequestUser") final String requestUser,
     @WebParam(name = "identifier") final Long identifier)
     throws SomeException;

谢谢, 莱斯2

I'm hoping that an extension of some kind is available that does this (although I suppose that my hope is foolishly optimistic).

   /**
     * <p>
     * Gets the {@link ResultObject} given the identifier. The following
     * fields are not available for some users and will contain a null value:
     * </p>
     * 
     * <ul>
     * <li>{@code resultObject.comment}</li>
     * <li>{@code resultObject.anotherObject.actionById}</li>
     * <li>{@code resultObject.anotherObject.actionByName}</li>
     * </ul>
     * 
     * <p>
     * The {@code daysInPurgatory} value will be {@code -1} when not
     * applicable
     * </p>
     * 
     * @param requestUser
     *            the user initiating the request
     * @param identifier
     *            the id of the ResultObject
     * @return the {@link ResultObject} or {@code null} if none exists
     * @throws SomeException
     *             if the {@code identifier} is {@code null}
     */
    @WebMethod
    @WebResult(name = "resultObject")
    public ResultObject getResultObjectById(
     @WebParam(name = "RequestUser", header = true, partName = "RequestUser") final String requestUser,
     @WebParam(name = "identifier") final Long identifier)
     throws SomeException;

Thanks,
LES2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沉鱼一梦 2024-08-18 13:40:19

您可以查看阐明。可以使用 它的 Maven 插件 从 Javadoc 注释生成静态 HTML 文件。这适用于 SOAP(即 JAX-WS)和 REST(即 JAX-RS)端点。

有趣的阅​​读:

生产示例:

You may look at Enunciate. It's possible to use it's Maven plugin to generate static HTML files from Javadoc comments. This works for SOAP (i.e. JAX-WS) and REST (i.e. JAX-RS) endpoints.

Interesting reads:

Production Examples:

霊感 2024-08-18 13:40:19

您并不是唯一一个在寻找生成 WSDL 文档的方法的人(请参阅从 Javadoc 生成 WSDL 文档线程)但是,据我所知,没有标准 JAX-WS 方法可以做到这一点。

现在,也许看看 中提到的 JBoss 专有注释 @Documentation JBWS-1850 生成 2.9 Javadoc 定制(当使用 Java->WSDL 方法时也是如此)。这并不完全是您所要求的,但它可能会给您一些想法。

无论如何,我猜想这需要提供您自己的 WSDLGeneratorExtension 来扩展 wsgen 并生成所需的 WSDL。

You're not the only one looking for a way to generate WSDL documentation (see the Generating WSDL documentation from Javadoc thread) but, AFAIK, there is no standard JAX-WS way for doing this.

Now, maybe have a look at JBoss proprietary annotation @Documentation mentioned in JBWS-1850 that generates jaxws:binding artifacts described in section 2.9 Javadoc Customization when using Java->WSDL approach as well. It's not exactly what you asked for but it might give you some ideas.

In any case, I guess that this would require providing your own WSDLGeneratorExtension to extend wsgen and generate the desired WSDL.

无人问我粥可暖 2024-08-18 13:40:19

在一个项目中,我们发布了很多 WSDL。对于每个 Web 服务,我们都公开了一个 WS 方法“getDocumentationURL()”。此方法返回一个指向从 SEI 生成的 JavaDoc 的链接。 JavaDoc 放置在可访问的 Intranet 服务器上。

In one project we published a lot of WSDLs. For every Web Service we have exposed a WS method "getDocumentationURL()". This method deliver back a link to the JavaDoc generated from the SEI. The JavaDoc was place on a accessible intranet server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文