I'm using wsconsume to generate artifacts for a JBoss 4.2 JAX-WS service (this is mentioned in one other post where I encountered JAXB errors)
There are JAXB errors related to the WSN Notification spec. The issue seems to be that some types are defined as QName with no parms and the generated code can't handle these.
It can't instantiate QName. If I modify the generated code to make it a String, it loads.
So you can see AXIS2 creates the List with a QName("", "messageTypes")
and wsconsume (JAXB) does not
# java.lang.IllegalStateException: Cannot build JAXB context
# at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilder.createJAXBContext(JAXWSMetaDataBuilder.java:925)
# @XmlAttribute/@XmlValue need to reference a Java type that maps to text in XML.
# this problem is related to the following location:
# at protected java.util.List org.oasis_open.docs.wsn.t_1.TopicType.messageTypes
So the problem is that the generated wsconsume stubs define messageTypes as List<QName>. If I change it to List<String> I get past the problem.
But obviously, this is not good. I want to implement the Oasis WSN spec and generate working stubs and go from there.
Do I need to create JAXB binding files to somehow change the type of xsd:QName to something else? e.g. QName("", "messageTypes")
(I can pass binding files into the wsconsume process)
How can I do this?
Can I get a sample?
Can you provide a link to the complete XML schema containing the data structure you have problems with?
I do not use Axis, but I am regardless curious to see what JAXB makes out of that schema.
I come to think of using a JAXB mapping file to map QName to String, but I will take a look and let you know.