[
https://issues.apache.org/jira/browse/CXF-5365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13808379#comment-13808379
]
Daniel Kulp commented on CXF-5365:
----------------------------------
With the requirement of using Woodstox 4.2.x for general parsing, we recently
flipped some of the validation for provider/dispatch things from a VERY
expensive validation routine to the routines built into Woodstox which are
based on MSV. Previously, with validation on, the message had to parsed to a
DOM, traversed fully to find any "xop" elements, if xop found, COPY the entire
dom (full traversal), do yet another traversal to remove the XOP's, then
traverse the whole thing yet again to actually validate. With Woodstox+MSV,
we can do the whole thing in a single traversal which obviously saves
time/memory.
However, you found a few bugs:
1) The above requires cxf-wstx-msv-validation.jar, which the demo doesn't
have. In theory, that SHOULD drop back to the old algorithm. A bug only drops
back if the incoming DOM has a XOP element. Sigh... :-(
2) If you add the cxf-wstx-msv-validation jar, then the above should work.
However, MSV doesn't like the WSDL's/schemas as you are "including" schemas
that have a targetNamespace. If you change the types section in the wsdl to:
{code:xml}
<wsdl:types>
<xsd:schema elementFormDefault="qualified"
targetNamespace="http://www.w3schools.com/c">
<xsd:import namespace="http://www.w3schools.com/a"
schemaLocation="a.xsd"/>
<xsd:import namespace="http://www.w3schools.com/b"
schemaLocation="b.xsd"/>
</xsd:schema>
</wsdl:types>
{code}
to import the full schemas, then it should work.
> 2.7.7 schema validation seems broken
> ------------------------------------
>
> Key: CXF-5365
> URL: https://issues.apache.org/jira/browse/CXF-5365
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime
> Affects Versions: 2.7.7
> Reporter: Jesse Pangburn
> Labels: schema, validation
> Fix For: 2.7.8
>
> Attachments: jaxws_dispatch_provider_schematest_276.zip,
> jaxws_dispatch_provider_schematest_277.zip
>
>
> Turning on schema validation in 2.7.7 seems to have a number of problems. In
> the case of my own embedded CXF, it does validate but fails with schemas that
> have circular references to each other (not illegal according to W3C spec or
> their schema validator tool online).
> So I wrote a test sample but found that in the test sample that it doesn't
> validate the schema at all- just lets the bad elements go through with no
> error. The 2.7.6 version of the sample properly throws an error- and all I
> did to create the 2.7.6 version was to copy the sample folder under 2.7.6 and
> search/replace 2.7.7 in the pom.xml with 2.7.6.
> For this issue, I think we should try to solve why 2.7.6 properly throws an
> exception on a request with a bad schema and why 2.7.7 does not. I'll check
> separately if the resolution to this fixes my initial problem and if it
> doesn't then I'll create a separate issue for that along with a test case.
> I will attach the test sample after creating the issue.
--
This message was sent by Atlassian JIRA
(v6.1#6144)