有没有一种方法可以使用JAX-WS从Javadoc生成WSDL文档?

20

我希望有某种扩展可用于此(尽管我认为我的希望过于乐观了)。

   /**
     * <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;
谢谢,LES2。
3个回答

10

Enunciate已经迁移到github,但仍然非常棒! - Justin Wrobel

8

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

现在,也许可以看一下JBoss专有注释@Documentation,该注释在JBWS-1850中提到,在使用Java-> WSDL方法时生成描述在2.9 Javadoc自定义部分中描述的jaxws:binding工件。虽然不完全符合您的要求,但可能会给您一些想法。

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


@LES2 喔?嗯,我不知道(这对我来说很遗憾,因为如果我记得没错的话,这个问题上有赏金:)。也许你可以给 team@stackoverflow.com 发邮件或在 http://meta.stackoverflow.com 上开一个问题来提到这个问题。 - Pascal Thivent

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接