You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "joerg@kiegeland.com" <jo...@kiegeland.com> on 2011/08/25 17:09:09 UTC
bottom-up WSDL deployment removes schemaLocation attribute
In AbstractDataBinding.addSchemaDocument, all schemaLocation attributes
from any import statements are removed as some kind of "patch" (the
schemaLocation attribute was generated before).
(1) anyone knows what patch the code speaks about (variable patchRequired)
(2) if the WSDL is read from a WS client, the import element cannot
resolve the declared namespace to an XSD since the schemaLocation
attribute is removed. I do not understand the logic of this patch...?
Re: bottom-up WSDL deployment removes schemaLocation attribute
Posted by "joerg@kiegeland.com" <jo...@kiegeland.com>.
> When doing java-first stuff, the WSDL that we generate uses inline schemas as
> it simplified things quite a bit. When inlining the schemas, there shouldn't
> be schemaLocations on the imports. JAXB sticks kind of "fake"
> schemaLocations there that we strip off.
I cannot follow your explanations, perhaps I should describe what I
wanted to do as finding this "bug":
I added a package-info.java to define a different namespace and schema
location for all JAXB types in the same java package:
@javax.xml.bind.annotation.XmlSchema(namespace = "http://core/1.0",
location = "http://core/1.0/download.xsd")
Now the documetation of XmlSchema.location() says
"
Indicates that this namespace (specified by namespace()) has a schema
already available exeternally, available at this location.
This instructs the JAXB schema generators to simply refer to the pointed
schema, as opposed to generating components into the schema. This schema
is assumed to match what would be otherwise produced by the schema
generator (same element names, same type names...)
"
But the "patch" prevents to point to an externally available schema -
but also no JAXB types are inlined - so the type information is simply
missing for a WS client. It seems to me that the patch is useful in
another situation (but which I not fully understood from your
explanations) but in my situation it produces a severe bug..
Re: bottom-up WSDL deployment removes schemaLocation attribute
Posted by Daniel Kulp <dk...@apache.org>.
When doing java-first stuff, the WSDL that we generate uses inline schemas as
it simplified things quite a bit. When inlining the schemas, there shouldn't
be schemaLocations on the imports. JAXB sticks kind of "fake"
schemaLocations there that we strip off.
Dan
On Friday, August 26, 2011 1:09:09 AM joerg@kiegeland.com wrote:
> In AbstractDataBinding.addSchemaDocument, all schemaLocation attributes
> from any import statements are removed as some kind of "patch" (the
> schemaLocation attribute was generated before).
>
> (1) anyone knows what patch the code speaks about (variable patchRequired)
Just a detection if we need to patch the imports (aka: remove them) Since
removing them involves copying the DOM, walking it, etc..., it can be a bit
expensive so if there isn't an import, we can skip a lot of it.
> (2) if the WSDL is read from a WS client, the import element cannot
> resolve the declared namespace to an XSD since the schemaLocation
> attribute is removed. I do not understand the logic of this patch...?
If a wsdl is read and is completely valid, this code should likely not even
get hit.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com