问题
Like the title says: Is it possible to export my javadoc comments for web service method parameters into the wsdl? We're using CXF and the java2ws goal with maven to generate the wsdl from source code.
回答1:
You can use the @WSDLDocumentationCollection
annotation to attach multiple @WSDLDocumentation
annotations to a single method (with different placements) but you can't use this to go much deeper than placing documentation on single operations of a port, because that's where it ceases to be a WSDL problem and becomes an XSD problem. XSD documentation would be handled by an annotation at the JAXB level, except that no such annotation exists; the schema generated won't contain <xs:documentation>
elements. (When starting from a schema, documentation comments can be generated as Javadoc, but the reverse direction doesn't happen as Javadoc comments aren't retained in Java class files.)
来源:https://stackoverflow.com/questions/8266596/export-source-code-comments-to-the-wsdl-using-cxf-and-maven