20080207 Thursday February 07, 2008

Meaningful parameter names from java2wsdl

I ran the axis java2wsdl tool, and it spit out WSDL that looked like this:

  <schema elementFormDefault="qualified" ...>
   <element name="in0" type="xsd:string"/>
   <element name="in1" type="xsd:string"/>
   <element name="in2" type="xsd:string"/>

... and so on. This was really depressing, because my java source actually had meaningful parameters name, not "in0" and such. I was sure I had found a bug in java2wsdl. But, as it turns out, it was operator error as usual. The compiled class files I had used to generate the WSDL files had no parameter names.

The trick to get my names back was to add the 'debug="on"' attribute to my ant javac command.

   <javac srcdir="${src}" destdir="${classes}" debug="on" > ... </javac>

You can also replicate this with the command line javac command by adding the -g option.

This basically adds debugging information, such as parameter names, to the compiled class files. When I reran java2wsdl, all was well.

Posted by rickg ( Feb 07 2008, 10:13:03 AM PST ) Permalink Comments [2]