[MOBY-dev] JAX-WS BioMoby API (2nd round).

Dmitry Repchevsky dmitry.repchevski at bsc.es
Wed Jan 16 16:45:52 UTC 2008


Hello Mark,

I understand what you say.

For ANY valid XML document appropriate schema CAN be generated...
But it doesn't mean that you can generate a schema that match a 
different set of XMLs.
Well, maybe you can, but the schema itself could be unusable...

> The resulting flexibility in document structure cannot be handled  
> by XML Schema.

Well the schema is not good in defining relationships, but it's 
definitely possible.

> It sucks for us, since we want to use WSDL... but it's a painful reality.

I'm not sure... I'm looking to it from Java point of view... lets say we 
have C extends B extends A.

If we pass B as a parameter to the webservice two things happens. We 
would have Schemas for B/A in WSDL and Java method that accepts B.
Something like call(B b).
Now imagine JAXB got "C" it's unknown to it so it can't parse it (it CAN 
parse it if we implicitly add it into the JAXBContext), so we need to 
know it A PRIORY.

It is can be done by regenerating all the classes while creating the 
context (takes a lot of time).
I discussed this in forums and the problem is that you can't change the 
context once it is created. by now they proposed an ugly (IMHO) hack 
with @SeeAlso annotation when you can accept B, but tell JAXB that there 
is also a "C" to take into account... again it doesn't help too much.

Fortunately (!) in WSDL 2 it's possible to mix RDF with XML Schema - XML 
Schema specify the data format and RDF a relationship, so (as far as I 
understand) it should work automatically - when you find something that 
you don't understand - you look into the RDF to find a substitute... I 
know AXIS 2.0 claims to support it, but I always prefer JCP 
specifications (somehow those are that goes into JEE).

Best regards,

Dmitry





More information about the MOBY-dev mailing list