Unity Logo

Documenting WSDL

Sometimes to make your users work easer you may want to add some documentation entries to generated  WSDL. Such WSDL is easer to read and generated client code contains nice java docs with operations description. XFire allows you to do this with documentation mapping files which works in similar way to aegis mapping file. Such file must be placed in package where your service is placed and named as <ServiceName>.doc.xml e.g. BookService.doc.xml for BookService.java service. Documentation mapping file have following format :

<service>
 <documentation>
 </documentation>
 <method name="" parametersNumber="" >
   <documentation />

   <parameter index="0">
       <documentation/>
   </parameter>

<return>
  <documentation />
</return>

 <exception class="">
    <documentation />
 </exception>

</method>
</service>

Full working sample of documentation mapping files can be found in examples/book appliction from XFire distribution.

You can also use XFire to generate documentation mapping files for all your service based on java docs from your classes. That can be done with WsDocGenTask with following properties :

- outputDirectory : where generated files will bu placed

- srcDirectory : root directory of your source code

- filePath : path to your service.xml ( or spring context ) file. 

© 2003-2008 Codehaus