有什么方法可以使用JAX-WS从Javadoc生成WSDL文档吗?
我希望可以使用某种类型的扩展(尽管我认为我的希望是愚蠢的乐观)。
/** * * Gets the {@link ResultObject} given the identifier. The following * fields are not available for some users and will contain a null value: *
* * * - {@code resultObject.comment}
* - {@code resultObject.anotherObject.actionById}
* - {@code resultObject.anotherObject.actionByName}
*
* * * The {@code daysInPurgatory} value will be {@code -1} when not * applicable *
* * @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
你可以看看Enunciate 。 可以使用它的Maven插件从Javadoc注释生成静态HTML文件。 这适用于SOAP(即JAX-WS)和REST(即JAX-RS)端点。
有趣的读物:
- https://github.com/stoicflame/enunciate/wiki/Documentation-Only
- http://raibledesigns.com/rd/entry/my_experience_with_java_rest
生产实例:
您不是唯一一个寻找生成WSDL文档的方法(请参阅从Javadoc线程生成WSDL文档 ),但是,AFAIK,没有标准的 JAX-WS方法来实现这一点。
现在,也许看看JBWS-1850中提到的JBoss专有注释@Documentation
生成jaxws:binding
使用Java-> WSDL方法时在2.9节Javadoc Customization中描述的jaxws:binding
工件。 这不完全是你要求的,但它可能会给你一些想法。
无论如何,我想这需要提供你自己的WSDLGeneratorExtension
来扩展wsgen
并生成所需的WSDL。
在一个项目中,我们发布了许多WSDL。 对于每个Web服务,我们都公开了一个WS方法“getDocumentationURL()”。 此方法返回指向从SEI生成的JavaDoc的链接。 JavaDoc位于可访问的Intranet服务器上。