CXF's @SchemaValidation annotation not effective on method level

Solution Verified - Updated -

Issue

  • The annotation org.apache.cxf.annotations.SchemaValidation is defined with
    @Target({ ElementType.TYPE, ElementType.METHOD })

However, applying it to single methods of a web service has no effect. More precisely, the following tests lead to unexpected results:

- no annotation on class, annotation on method: the method-level annotation has no effect

- annotation on class, annotation on method (with SchemaValidationType.NONE for overriding the class-level annotation): the method-level annotation has no effect
  • For testing, we used sample project and the following SOAP request that does not conform to the web service's schema because of the "x" attribute:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://redhat.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <sam:foo x="y"/>
   </soapenv:Body>
</soapenv:Envelope>

Environment

  • Red hat JBoss Enterprise Application Platform (EAP)
    • 6.4.x
  • JBossWS-CXF

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content