JAX-RPC specifies XML -> Java name translation, which Axis implements.
JavaBean properties have a lower-case first letter.

Axis should include the XML name in the Meta-data in the Bean, so
that on the wire, the XML element has the name specified in the WSDL.

Hope this helps.
--
Tom Jordahl


-----Original Message-----
From: dweber [mailto:dweber@;asyst-connect.com]
Sent: Monday, November 11, 2002 2:38 AM
To: [EMAIL PROTECTED]
Subject: problem solved for de-serializer, bean question


I've finally solved my client connection problems with axis, and the problem
ended up being an issue with the naming of the bean property.  Essentially,
I had a message:

<IsEdaEnabledResponse>
  <IsEnabled>false</IsEnabled>
</IsEdaEnabledResponse>

and a class to handle this response (I'm simplifying the message structure).
I finally figured out that the wsdlToJava tool was not (for me) correctly
implementing the stubs (which is another story).  I hand-finagled the stub
to add the response message, but kept getting the error about an invalid
element - IsEnabled.  I verified that the field was present in the response
stubs TypeDescr field, but no joy.  I finally downloaded the source and
spent the weekend digging through the serialization logic, and finally found
the section in BeanUtils where the property descriptors were acquired using
Introspector.getBeanInfo().getPropertyDescriptors().

When I printed out the fields returned by this method (using getName() on
each property), I found that the bean field was named "isEnabled", while the
tag was named "IsEnabled" - note the case issue.  Once I modified the server
to return the tag as "isEnabled" the code worked fine.

The bizarre thing, and what prompts my question, is that the response class
*does not have a field named "isEnabled"*, it's named "IsEnabled". [private
boolean IsEnabled;] The accessors are named "getIsEnabled" and
"setIsEnabled", there isn't a lowercase "isEnabled" anywhere to be found.

For my server, this won't be an issue, since I control the tags.  It's quite
possible this will be an issue when I connect to the real server, which has
the uppercase first letter in the tag.

Can someone explain where this field comes from, and if it's possible to set
it somehow?

Reply via email to