My WSDL does a xsd:include for numerous schemas.  One of those schemas
does a xsd:import of another schema.  I need to specify the package
mapping for that imported schema.

For all the schemas that were xsd:included, I have "jaxws:bindings"
elements in my bindings file with node xpaths that point to the schema
with a particular targetNamespace value.

I tried adding a "jaxws:bindings" element corresponding to that imported
schema, but it fails, saying it can't find a node with that xpath.  Not
too surprising.

I then tried changing that one "jaxws:bindings" element to a
"jaxb:bindings" element, with "schemaLocation" and "node" attributes.
This half worked.  It didn't fail, but the classes it generated for that
schema were in the "default" package defined by the namespace, not in
the package defined in the nested "jaxb:package" element (inside the
"jaxb:schemaBindings" element).

I then tried creating a separate "jaxb" bindings file and specifying
both on the WSDLToJava command line.  Curiously, not only did that
result in the classes being generated in the correct package, it didn't
generate them in the wrong package.

Is this the expected pattern?  The JAX-WS bindings can only be used for
namespaces that are directly referenced from the WSDL, and then any
other namespaces have to be handled in a separate JAXB bindings file?

Reply via email to