I have a wsdl from a server that is using Axis
"message" style and using Castor for the xml binding.
On the client side I run wsdl2java to generate my classes and write an
implementation to call the service.
The wsdl has an xsd:choice element in it.
When I call the web service from the client side the SOAP message has an
element for the xsd:choice that I populated but it also has elements with
xsi:null for the other two choices. This is causing problems on the server
side because it is failing Castor validation.
Why does axis put in the elements for the other choices with xsi:null in
them?
Our developer ultimately got around this problem by adding minOccurs=0 to
every element inside the xsd:choice block. I was surprised that he also
had to add minOccurs to children elements of those elements in the xsd:choice
block.
Whats up with that? There is a chance that for one of the choices I would need to have children elements that must exist if the parent choice exists. In this case i would have to set minOccurs=1 which would then add the element with xsi:null when I made a different choice.
Is this an Axis bug or is it my lack of XML Schema knowledge?
thanks
Keith
