Un modo per generare la documentazione WSDL da Javadoc con JAX-WS?
-
20-09-2019 - |
Domanda
Spero che una proroga di qualche tipo è disponibile che fa questo (anche se suppongo che la mia speranza è stupidamente ottimista).
/**
* <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;
Grazie, Les2
Soluzione
Puoi guardare enunciate . E 'possibile utilizzare è Maven plug per generare file HTML statici da commenti Javadoc. Questo funziona per SOAP (vale a dire JAX-WS) e riposo (ossia JAX-RS) endpoint.
Interessante legge:
- https://github.com/stoicflame/enunciate/wiki/Documentation-Only
- http://raibledesigns.com/rd/entry/my_experience_with_java_rest
Esempi di produzione:
Altri suggerimenti
Non sei il solo alla ricerca di un modo per generare la documentazione WSDL (vedere la documentazione di Generazione WSDL da Javadoc filo), ma, per quanto ne so, non c'è standard JAX-WS modo per fare questo.
Ora, forse uno sguardo a JBoss @Documentation
annotazione di proprietà di cui JBWS-1850 che genera artefatti jaxws:binding
descritti nella sezione 2,9 Javadoc personalizzazione quando si utilizza Java-> approccio WSDL pure. Non è esattamente quello che hai chiesto, ma potrebbe dare qualche idea.
In ogni caso, credo che ciò richiederebbe fornire il proprio WSDLGeneratorExtension
per estendere wsgen
e generare il WSDL desiderato.
In un progetto abbiamo pubblicato un sacco di WSDL. Per ogni servizio Web che abbiamo esposto un metodo WS "getDocumentationURL ()". Questo metodo offrire di nuovo un collegamento alla JavaDoc generato dalla SEI. Il JavaDoc è stato posto su un server intranet accessibili.