JAXWS: A RequestWrapper or ResponseWrapper class may lack an @XmlRootElement
----------------------------------------------------------------------------
Key: AXIS2-4803
URL: https://issues.apache.org/jira/browse/AXIS2-4803
Project: Axis2
Issue Type: Bug
Reporter: Rich Scheuerle
Assignee: Rich Scheuerle
Background:
The JAX-WS @RequestWrapper and @ResponseWrapper annotations identify JAXB beans
to marshal and unmarshal the data.
The JAXB wrapper bean normally contains an @XmlRootElement annotation, which
defines the xsd:element rendering of the data.
However the @XmlRootElement is not required.
Prior changes to the JAX-WS runtime have enabled support for wrappers with just
the @XmlType annotation.
The JAX-WS engine constructs a JAXBContext using the packages referenced by the
web service when all of the referenced packages contain a JAXB ObjectFactory.
This strategy assumes that each ObjectFactory will reference all of the beans
representing root types and that all other necessary beans have an
@XmlRootElement annotation.
Problem:
We encountered the following scenario:
* The @RequestWrapper references a JAXB bean.
* The wrapper bean does not have an @XmlRootElement, but it does have an
@XmlType.
* The ObjectFactory does not reference the wrapper bean.
The current runtime fails to include the JAXB bean in its JAXBContext. This
causes marshaling and unmarshaling failures.
Solution:
The JAXBUtils code constructs the JAXBContext. JAXBUtils has a list of all
of the classes referenced by the web service.
Code will be added to inspect the new JAXBContext to ensure that it contains
all of the referenced classes.
If it does not, the code will fall back to the pre-existing "construct
JAXBContext using individual classes" algorithm.
This is a small change.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]