Javadoc에서 Jax-WS와 함께 WSDL 문서를 생성하는 방법이 있습니까?
-
20-09-2019 - |
문제
나는 어떤 종류의 확장이이를 수행 할 수 있기를 바라고있다 (나는 나의 희망이 어리석게 낙관적이라고 생각하지만).
/**
* <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
해결책
당신은 볼 수 있습니다 발음. 사용할 수 있습니다 Maven 플러그인입니다 Javadoc 주석에서 정적 HTML 파일을 생성합니다. 이것은 SOAP (예 : JAX-WS) 및 REST (예 : JAX-RS) 엔드 포인트에 대해 작동합니다.
흥미로운 읽기 :
- https://github.com/stoicflame/enunciate/wiki/documentation-ly
- http://raibledesigns.com/rd/entry/my_experience_with_java_rest
생산 예 :
다른 팁
당신은 WSDL 문서를 생성하는 방법을 찾고있는 유일한 사람이 아닙니다 ( Javadoc에서 WSDL 문서 생성 스레드) 그러나 Afaik, 아니요 기준 이 작업을 수행하는 Jax-W Way.
이제 jboss 독점 주석을 살펴 보겠습니다. @Documentation
언급 JBWS-1850 그것은 생성됩니다 jaxws:binding
섹션에 설명 된 아티팩트 2.9 Javadoc 사용자 정의 java-> wsdl 접근법을 사용할 때도. 그것은 당신이 요구 한 것이 아니라 아이디어를 줄 수 있습니다.
어쨌든, 나는 이것이 당신 자신의 것을 제공해야한다고 생각합니다 WSDLGeneratorExtension
확장하려면 wsgen
원하는 WSDL을 생성하십시오.
한 프로젝트에서 우리는 많은 WSDL을 게시했습니다. 모든 웹 서비스에 대해 WS 메소드 "getDocumentationUrl ()"을 노출 시켰습니다. 이 방법은 SEI에서 생성 된 Javadoc에 대한 링크를 다시 제공합니다. Javadoc은 액세스 가능한 인트라넷 서버에 배치되었습니다.