Hello!
I'm developing a web-service in some kind of contract-first terms - firstly,
I create xsd schemes, secondly, generate classes with JAXB upon them, and
then, I want to attach these schemes to WSDL. Here is my
applicationContext,xml:
<jaxws:endpoint id="webService"
implementor="#wsImplementer"
address="/service">
<jaxws:schemaLocations>
<jaxws:schemaLocation>classpath:/xsd/RequestWrapper.xsd</jaxws:schemaLocation>
</jaxws:schemaLocations>
</jaxws:endpoint>
The problem is: the RequestWrapper.xsd contains <xs:include
schemaLocation="ComplexTypes.xsd"/> and
ComplexTypes.xsd contains <xs:include schemaLocation="SimpleTypes.xsd"/>.
So, when CXF generates the WSDL, it contains the RequestWrapper.xsd scheme
with such an include http://service/path?xsd=ComplexTypes.xsd which is ok,
but if you walk to this link you'll see (ComplexTypes.xsd) with <xs:include
schemaLocation="SimpleTypes.xsd"/>. Of course, this is not a valid WSDL
cause it cannot load the SimpleTypes.xsd.
I've managed to find the workaround:
1) create a new scheme which consists of includes:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://custom/data"
xmlns="http://http://custom/data">
<xs:include schemaLocation="SimpleTypes.xsd"/>
<xs:include schemaLocation="ComplexTypes.xsd"/>
<xs:include schemaLocation="RequestWrapper.xsd"/>
</xs:schema>
2) delete all the includes from the other schemes.
That worked for me, but, as you can see, all the schemes are not valid
(there is no includes). That looks really dull to comment includes all the
time before exposing a web service. Can anybody please help me? How to go
through this?
--
View this message in context:
http://cxf.547215.n5.nabble.com/Attaching-xsd-schemes-to-make-WSDL-problem-tp5567174p5567174.html
Sent from the cxf-user mailing list archive at Nabble.com.