Skip to main content

Does JAXB 2.0 support xs:extension and xs:type?

3 replies [Last post]
rhaynie
Offline
Joined: 2005-07-20
Points: 0

Hello,

I have a question regarding xs:extension and xs:type support in JAXB 2.0. I have run wsimport on a set of wsdl and xsd files and it correctly generated jax-rpc 2.0 code that I can package and deploy successfully.

However, when the BaseSelectStmtType's element (snippet below) is present I get an Instantiation Exception from the runtime because it is trying to instantiate the abstract type QueryNode instead of one of its subtypes (NodeTypes.xsd snippet below).

I don't think it is a problem with the schemas because this is a port of an existing .Net 2.0 web service that unmarshals correctly.

Please let me know if I am not supplying enough information. Any help would be greatly appreciated.

-Roger

(Snippet from datasource-types.xsd

Message was edited by: rhaynie

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rhaynie
Offline
Joined: 2005-07-20
Points: 0

Hello,

Is there some way that I could manually register the derived classes with JAXB from JAX-WS, so that it can work? I REALLY don't want to drop down to the raw XML level.

Thanks for the fast replies.

Roger

kohsuke
Offline
Joined: 2003-06-09
Points: 0

JAXB does support the type substitution (that is the name of the feature you are using.)

However, for this to work correctly, JAXB needs to be informed of the Java class that coresponds to "s2:BinOpNode", and I suspect that there's a problem between JAXB and JAX-WS interaction and somehow this class isn't reported to JAXB.

I vaguely recall discussing about this internally. Let's see if the JAX-WS person can chime in.

kohlert
Offline
Joined: 2003-06-16
Points: 0

Kohsuke,
You are correct, we did discuss this some months ago but we have not come to a solution for this problem. It is an item on my unresolved issues list.