On 26/01/15 11:19, MayBee wrote:
*What I have done:*
1. I added my root xsds to the jaxrs:schemaLocations list.
2. I created a JAXB Provider of type
org.apache.cxf.jaxrs.provider.JAXBElementProvider, which also get the same
list of schemaLocations as already specified in jaxrs:schemaLocations to
enable xsd input validation.
Option 2. is sufficient, no need to use 1.

2.1. The JAXB Provider is than registered on the same jaxrs:server in the
jaxrs:providers collection.

*What I get:*
I: A generated WADL, which contains a different xsd to my declarations in
JAXB Provider & jaxrs:schemaLocations. It seems to be reconstructed from the
JAXB Objects.
WADLGenerator needs to be told to avoid auto-generating the schemas, see

http://cxf.apache.org/docs/jaxrs-services-description.html#JAXRSServicesDescription-RepresentingexternalschemasandnonJAXBtypes

Set a 'setSchemaLocations' property on WADLGenerator too. Having a generator to introspect the setting of individual providers in order to decide whether to auto-generate or not is really problematic



II: Furthermore, I get the xsd with namespace prefix "A" and my request and
response parameter types are of prefix "prefix1", which does not relate to
any xsd element declaration in the WADL.

The prefix name does not affect the namespace binding at all.
WADLGenerator will only use 'prefixN' if it auto-generates the grammar. However you can control that by having a package-level info where a preferred XMLSchema namespace prefix is set. WADLGenerator also has a 'namespacePrefix' property. This is all may needed only if you prefer to customize the auto generation process, no need to do it if you link to the external schemas

Sergey


--
View this message in context: 
http://cxf.547215.n5.nabble.com/included-xsd-s-are-not-resolved-for-wadl-generation-tp5753451p5753526.html
Sent from the cxf-user mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to